CODE:
local AI = script.Parent.Parent.Timer.PositionNumber
local Lighting = game.ServerStorage.Freddy
local World = game.Workspace.Animatronics.Freddy
local Footstep = script.Parent.Parent.Timer.RemoteFunction.Footstep.Sound
repeat game:GetService("RunService").Stepped:Wait() until AI.Value == 5
script.Parent.DoorTimer.Value = (math.random(10,15))
while game.Workspace.DoorL.Closed.Value == true do
wait(1)
script.Parent.DoorTimer.Value = script.Parent.DoorTimer.Value -1
end
So basically when I press a button on a model the boolean value turns true, and pressing it again makes it false. And this script makes it so when something certain happens a counter is randomly set, and having the mentioned BooleanValue set to true should subtract it every second its true. All the setups dont have problems, the BooleanValue changed, the DoorCounter gets randomly set,
But the main problem is getting the counter to go down when the BooleanValue is True

6 comments
is the boolean value getting set back to false when the door is closed?
it gets set to true when the door is closed and set to false when it isn't.
Try this: while game.Workspace.DoorL.Closed.Value == true do wait(1) if script.Parent.DoorTimer.Value == nil then script.Parent.DoorTimer.Value = script.Parent.DoorTimer.Value -1 end end
Have you found a solution yet? If so edit the script
Finally a hard question for me to solve thanks for posting.
hmmmmmmmmmmmmmm