I have a script inside of a model in workspace that changes an intValue to indicate how many seconds are left inside of one round located in ReplicatedStorage every time a second passes. When I test the game and touch the part that starts a round, the value doesn't change at all. Any suggestions?
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local timeRemaining = 0
local seconds = game.ReplicatedStorage.Seconds.Value
seconds = 0
if h~=nil then
script.Parent.Position = Vector3.new(-12.15, 621.894, 47.98)
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.Text = "3"
wait(1)
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.Text = "2"
wait(1)
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.Text = "1"
wait(1)
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.Text = "GO!"
wait(0.5)
script.Parent.Parent:FindFirstChild("Start").Transparency = "1"
script.Parent.Parent:FindFirstChild("Start").CanCollide = false
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.TextTransparency = 1
timeRemaining = 300
while timeRemaining > 0 do
wait(1)
timeRemaining = timeRemaining - 1
seconds = seconds - 1
script.Parent.Parent:FindFirstChild("Water").Position = script.Parent.Parent:FindFirstChild("Water").Position + Vector3.new(0,0.1,0)
end
wait(30)
script.Parent.Position = Vector3.new(-12.15, 21.894, 47.98)
script.Parent.Parent.Water.Position = Vector3.new(-12.15, -855.409, -1.52)
script.Parent.Parent:FindFirstChild("Start").Transparency = "0"
script.Parent.Parent:FindFirstChild("Start").CanCollide = true
script.Parent.Parent:FindFirstChild("Start").SurfaceGui.SIGN.TextTransparency = 0
timeRemaining = 0
end
end
script.Parent.Touched:connect(onTouched)
P.S. I'm new to scripting forums, so I may have formatted a things wrong. Sorry about that.

1 comment
are you in a local script?