Try Placing the Holding = false
after the Green = 0
if Green == 100 then
Green = 0
Holding = false -- This here.
workspace.Power.Button.Color = Color3.new(0,1,0)
game.ReplicatedStorage.RestorePower:FireServer(game.Players.LocalPlayer)
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Text = "Gained 50 Points!"
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Visible = true
workspace.Power.Sounds.PowerUP:Stop()
workspace.Power.Sounds.PowerUP2:Stop()
task.wait(1)
game.Players.LocalPlayer.PlayerGui.PowerGui.Restoring.Visible = false
task.wait(2)
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Visible = false
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Text = "Gained (Points)"
warn("Ending")
break
end
Then add a condition on InputEnded:
if game.Players.LocalPlayer:GetAttribute("CanRestorePower") and Holding then
Will try in a second. I made it print if it’s disabled or not and it turns true both times when asked after i set it as disables, both having a wait and one right after it gets set.
Still no. This is really strange.
Does it fire the server immediately when It reaches 100?
If not then change location of the game.ReplicatedStorage.RestorePower:FireServer()
after the Holding = false
if Green == 100 then
Green = 0
Holding = false
game.ReplicatedStorage.RestorePower:FireServer()
workspace.Power.Button.Color = Color3.new(0,1,0)
game.ReplicatedStorage.RestorePower:FireServer(game.Players.LocalPlayer)
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Text = "Gained 50 Points!"
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Visible = true
workspace.Power.Sounds.PowerUP:Stop()
workspace.Power.Sounds.PowerUP2:Stop()
task.wait(1)
game.Players.LocalPlayer.PlayerGui.PowerGui.Restoring.Visible = false
task.wait(2)
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Visible = false
game.Players.LocalPlayer.PlayerGui.PointsGui.PointsGained.Text = "Gained (Points)"
warn("Ending")
break
end
And remove the game.ReplicatedStorage.RestorePower:FireServer()
on the InputEnded.
It appears a bit un fixable. I think it would be better to re type it. It’s a bit faulty, anyways. Thank you for trying to help, tho.