Like all of my posts, I’ve said I’m making a FNaF 1 Remake on Roblox. I’ve already finished everything (almost), but I forgot something. When your power runs out, if your doors are being used, it will just disable it self and go up. How could I make this from a remote event?
My door script:
if not debounce then debounce = true
if not door then door = true
if _G.Door1Destroyed == tonumber(9) then
script.Parent.Door.eror:Play()
return
end
script.Parent.Door.Sound:play()
for i=0,15 do
script.Parent.Door.CFrame = script.Parent.Door.CFrame - Vector3.new(0,0.8,0)
wait()
script.Parent.DoorButton.Color = Color3.new(0.333333, 1, 0)
_G.Door1Enabled = 9
game.ReplicatedStorage.Remotes.UpdateUsage:Fire("Door1Enabled")
end
script.Parent.Door.CFrame = script.Parent.Door.CFrame - Vector3.new(0,0.2,0)
game.Workspace.Server.Power.Usage.Value = game.Workspace.Server.Power.Usage.Value + 1
debounce = false
elseif door then door = false
script.Parent.Door.Sound:play()
for i=0,15 do
script.Parent.Door.CFrame = script.Parent.Door.CFrame + Vector3.new(0,0.8,0)
wait()
script.Parent.DoorButton.Color = Color3.new(1, 0, 0)
_G.Door1Enabled = 10
game.ReplicatedStorage.Remotes.UpdateUsage:Fire("Door1Disabled")
end
script.Parent.Door.CFrame = script.Parent.Door.CFrame + Vector3.new(0,0.2,0)
game.Workspace.Server.Power.Usage.Value = game.Workspace.Server.Power.Usage.Value - 1
debounce = false
end
end
end)```
How to detect if there is no power: game.Workspace.Server.Power.Value == 0, I know how to do this but I don't really know how to make the doors go up. if _G.Door1Enabled = 9, then the door is enabled.