This should be easier than the other question I asked. I basically want the script to not overlap. For example, if I join the server, I'll see my banner. But if Qitsi comes in at a split second after I came in, his banner will automatically show. How do I not make it overlap?
game.Players.PlayerAdded:connect(function(player) if player.Name == "jmotoyama" then local f = Instance.new("TextBox", game.Workspace) f.Text = "Never fear, Jm the FT God is here." wait(4) f:Remove() wait(1) end end) game.Players.PlayerAdded:connect(function(player) if player.Name == "qitsi" then local f = Instance.new("Hint", game.Workspace) f.Text = "qitsi, the Tower Tormentor has arrived." wait(4) f:Remove() wait(1) end end)
You should make the PlayerAdded function check both names at once using elseif
. Currently for your code, when a player joins, it runs both of the PlayerAdded functions at once, which isn't good at all. You also have a few more problems, such as you using remove instead of Destroy.
game.Players.PlayerAdded:connect(function(player) if player.Name == "jmotoyama" and not workspace:FindFirstChild("TextBox") then local f = Instance.new("TextBox", workspace) f.Text = "Never fear, Jm the FT God is here." wait(4) f:Destroy() wait(1) elseif player.Name == "qitsi" and not workspace:FindFirstChild("TextBox") then local f = Instance.new("TextBox", workspace) f.Text = "qitsi, the Tower Tormentor has arrived." wait(4) f:Destroy() wait(1) end end)
Also, as pluginfactory explained, you need to check if the textbox is already in workspace or not. To do this, just add on to the check at the top of the code to see if it is already in workspace.
If this helped, make sure to thumbs up and accept this as your answer!
all you have to do is make sure that the textbox isn't in workspace when qitsi joins
game.Players.PlayerAdded:connect(function(player) if player.Name == "qitsi" and not game.workspace:findFirstChild("TextBox")then local f = Instance.new("Hint", game.Workspace) f.Text = "qitsi, the Tower Tormentor has arrived." wait(4) f:Remove() wait(1) end end)
**Hope this Helps!*