I'm in the process of making a game about watching paint dry. Yes, it doesn't make sense. Anyhow, the majority of the script works, where if the player touches the wall when the timer hasn't reached 10 then they're automatically kicked from the game, and if they wait ten seconds then they touch the wall they aren't kicked. The problem I'm having is that when trying to enable the Screengui with the win text on it using the script it doesn't fire. There are no problems pertaining to this highlighted in the output.
local timer = 1
repeat
timer = timer+1
print("TestLine")
wait(1)
until timer == 10
script.Parent.Touched:Connect(function(hit)
if timer ~= 10 then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player:Kick("You touched the paint. It was not dry.")
else
if timer == 10 then
game.StarterGui.ScreenGui.Enabled = true --This is the part where I'm having problems
end
end
end)
Any help is appreciated. Some notes:
- This is a server script, and not local.
- I have tested this numerous times with the same result.
