Syncing doors when a new player joins.

This commit is contained in:
Andyyy7666
2022-07-09 19:35:06 +02:00
committed by GitHub
parent 1ce05e4ab6
commit b84713e9a4

View File

@@ -1,5 +1,14 @@
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6
local updatedDoors = {}
RegisterNetEvent("ND_Doorlocks:syncDoor")
AddEventHandler("ND_Doorlocks:syncDoor", function(doorID, state)
updatedDoors[doorID] = state
TriggerClientEvent("ND_Doorlocks:syncDoor", -1, doorID, state)
end)
end)
RegisterNetEvent("ND_Doorlocks:getDoors")
AddEventHandler("ND_Doorlocks:getDoors", function()
local player = source
TriggerClientEvent("ND_Doorlocks:returnDoors", player, updatedDoors)
end)