Im making a fan-game about five nights at freddy's, And im having trouble with the power source, I made a value that tells the script if the the door im using is closed or open, If the door is closed it takes up power, But when i open it and close it again it doesn't take up power anymore! Iv tried many loops and if statements, But it seems it wont work!
pwrNum = script.Parent.Frame.PwrNum
Pwr = script.Parent.Frame.power
DawrPwrRmv = script.Parent.Frame.DoorOneRmv
doorone = game.Workspace.door.Door.OpenClosed
while doorone.Value == "Closed" do
wait(7)
Power = Pwr.Value - DawrPwrRmv.Value
pwrNum.Text = Power .. "%"
Pwr.Value = Power
end

3 comments
ok thanks! I'll try it out!
THANKS! It works!
No problem