Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Small PlayerAdded script not working?

This script is only 6 lines, and when I remove the PlayerAdded function and the end) it works perfectly fine, but when I try to start the game with this block of code nothing works. Any help? Thanks!

game.Players.PlayerAdded:connect(function(plr)
wait(3)
script.Parent.TextWelcome.Text = ("Welcome to Sky Hero!") --tried to do concat but playeradded function doesn't work
script.Parent.Parent.WelcomeFrame:TweenPosition(UDim2.new(0.3, 0, 0.1, 0), "Out", "Quad", 3, true)
end)

Also, if it helps at all this is the alignment in Explorer. [https://i.imgbomb.com/E1Q8p.jpg]

2 answers

✓ Accepted answer

Is that in a local script? PlayerAdded doesn't work in local scripts. You should use ChildAdded instead.

Well I don't necessarily believe you need the plr parameter if you're not going to use it.

4 comments

0

I was going to concatenate on line 3 but decided to look for the main problem first.

0

I believe the parameter is the problem. If you're not adding "Plr", then it's not needed.

0

Makes sense, but didn't quite work. I've tried removing the parameter and it didn't change anything. :/

0

Oh that's the problem, you need to insert it into playergui.

This discussion is preserved as it was. New answers, comments, and votes are closed.