So I want it to announce that the round will begin soon when the first person enters that the round will begin soon, but when I try it out nothing happens in the game or output.
Here's my script
function RoundBegin() Instance.new(Message("The round will begin soon")) Wait(3) Message:remove() end
game.Players.PlayerAdded:connect(RoundBegin)
What did I do wrong?
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)