Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I find myself if I join?

Asked by 9 years ago

How would I be able to find the name of an AddedPlayer?

For example, a new player joined.

If it found out it was me, then it would say "The owner has joined with the server" How can I do that?

1 answer

Log in to vote
2
Answered by 9 years ago

Hmm, I'd probly do this;

game.Players.PlayerAdded:connect(function(plr) --Player Added as you mentioned before
if plr.Name:lower()==("groovydino"):lower()then --If Player's name matches to yours
players=game.Players:GetChildren() --Get the children of Players
for i,v in pairs(players)do --The for loop
if v:IsA("Player")then --If v is a Player
if v:FindFirstChild("PlayerGui")and v.Character then --If PlayerGui and Character exists
m=Instance.new("Message",v.PlayerGui) --Makes a new message, and parents it to PlayerGui
m.Text="The owner has joined the server!" --The Text announcing that you had joined
wait(4) --Waits 4 seconds
if m~=nil then --If Message still exists
m.Text="" --The Text is now blank
m:remove() --Message is removed
end end end end end end) --All the `ends` for PlayerAdded, the `if`'s, and the `for` loop

I hope this helped!

Ad

Answer this question