✓ Accepted answer
alot of places. First, when you Instance something, you have to make sure its the right classname, and then set the text property.
function round(player,text,time)
local m = Instance.new("Message",player.PlayerGui)
m.Text = text
wait(time)
m:Destroy()
end
game.Players.PlayerAdded:connect(function(player)
round(player,"The round will begin soon",3)
end)
this means as soon as a player joins, it calls a function and only does it when they join. However, if the PlayerGui doesn't load in time, it will error. I would say use WaitForChild(), but for some reason it won't let me use it on a player, so I suggest waiting on the character.
function round(player,text,time)
local m = Instance.new("Message",player.PlayerGui)
m.Text = text
wait(time)
m:Destroy()
end
game.Players.PlayerAdded:connect(function(player)
workspace:WaitForChild(player.Name)
round(player,"The round will begin soon",3)
end)
1 comment
Oh cool thanks that makes sense :)