Ello DevForum lads,
so i have this lock feature on my door and i just realized the whole time the the boolvalue wasnt changed and instead some variable inside the script was getting set true and false. However why dosent it change the boolvalue ??? am i doing something wrong ???
local Model = script.Parent
local Handler = Model:WaitForChild("Handler")
local Knob = Model:WaitForChild("Knob")
local Locked = Model:WaitForChild("Locked")
local Unlocked = Model:WaitForChild("Unlocked")
local Door = Model:WaitForChild("Door")
local DoorLock = Model.Werte:WaitForChild("DoorLock")
local Rammed = Model.Werte:WaitForChild("Rammed")
local OpenOrClose = Model.Werte:WaitForChild("OpenOrClose")
local LockDoor = Model.Werte:WaitForChild("LockDoor")
local KnockDoor = Model.Werte:WaitForChild("KnockDoor")
local IsOwner = Model.Parent.WWerte:WaitForChild("VOwner")
-- this just a checker to run functions but this checks if the door wasnt battering rammed or isnt locked
OpenOrClose.OnServerEvent:connect(function(player)
if DoorLock == true and not OpenOrCloseDebounce and not Rammed then
OpenOrCloseDebounce = true
script.Parent.Door.DOpenLocked:Play(true)
wait(1)
OpenOrCloseDebounce = false
elseif not Open and not OpenOrCloseDebounce and not Rammed then
OpenOrCloseDebounce = true
OpenDoor()
elseif Open and not OpenOrCloseDebounce and not Rammed then
OpenOrCloseDebounce = true
CloseDoor()
end
end)
-- Problem starts here
local LockDoorDebounce = false
LockDoor.OnServerEvent:connect(function(player)
if LockDoorDebounce then return end
LockDoorDebounce = true
if DoorLock == false and player.Name == IsOwner.Value then
DoorLock = true
script.Parent.Door.SLock:Play(true)
script.Parent.Unlocked.Transparency = 1
script.Parent.Unlocked.CanCollide = true
script.Parent.Locked.Transparency = 0
script.Parent.Locked.CanCollide = false
wait(1)
elseif DoorLock == true and player.Name == IsOwner.Value then
DoorLock = false
script.Parent.Door.SUnlock:Play(true)
script.Parent.Unlocked.Transparency = 0
script.Parent.Unlocked.CanCollide = false
script.Parent.Locked.Transparency = 1
script.Parent.Locked.CanCollide = true
wait(1)
end
LockDoorDebounce = false
end)
-- Problem ends here