✓ Accepted answer
You basically had a bunch of the same error in your script. I'll go ahead, and post the fixed script first, then explain it a bit.
Here it is:
while true do
local Gamestart = workspace.Gamestart
local Intermission = workspace.Intermission
local Inttime = workspace.Inttime
local Resources = workspace.Resources
Intermission.Value = true
repeat wait(1)
if Inttime.Value>0 then
Inttime.Value=Inttime.Value-1
end
until Inttime.Value<=0
if Inttime.Value == 0 then
Intermission.Value = false
Inttime.Value = 30
wait()
Gamestart.Value = true
if Resources.Value == 0 then
Gamestart.Value = false
local plrs = game.Players:GetPlayers()
for _, player in pairs(plrs) do
if player.Character and player.Character:FindFirstChild("Humanoid") then
player.Character.Humanoid.Health = 0
end
end
end
end
end
So basically, the error you had was that you were defining the Variables: Gamestart, Intermission, Inttime, and Resources, as their Values. When you do this, the script stores the variable as what the value of it was at the time it was called.
Here's an example:
local ValueExample=script.Parent.Value
script.Parent.Value=not script.Parent.Value
print(ValueExample)
This would happen because the value is being changed correctly, but as I already stated, it is storing the value, not the object that you need to access to change it's property.
To fix the above script, we would do this:
local ValueExample=script.Parent
script.Parent.Value=not script.Parent.Value
print(ValueExample.Value)
This time we accessed the object, and were able to change it's property correctly, so the script worked out how we wanted it to.
Anyways, I hope this helped you out a bit. If you have any problems/questions, please leave a comment below :P
2 comments
tauhruiwyaieuyro there are like 13 errors.
it doesnt show me any errors :/ weird