Does somebody know why the text gui does not work? I would like to come up with a gui for 5 seconds to tell wich player won the obby. But I have no idea why this won't work. Can somebody help me/explain it?
finish.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if not debounce then
debounce = true
player.leaderstats.Carrot.Value = player.leaderstats.Carrot.Value + 1000
print(player.Name.." has won the Carrot Obby and recieved 1000 Carrots!")
for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
if plr.Character then
plr.Character.HumanoidRootPart.CFrame = spawnpoint.CFrame
print("All players have been teleported to: "..spawnpoint.Name)
end
end
game.StarterGui.ObbyGui.WinText.Text = (player.Name.." has won the Carrot Obby!")
game.StarterGui.ObbyGui.WinText.Visible = true
wait(5)
debounce = false
game.StarterGui.ObbyGui.WinText = false
end
end
end)

1 comment
^^ text can be found at line 16-20. (That part does not work)