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

Small PlayerAdded script not working?

Asked by
bloxxyz 274 Moderation Voter
10 years ago

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

Log in to vote
1
Answered by
AmiracIe 175
10 years ago

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

Ad
Log in to vote
-1
Answered by 10 years ago

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

0
I was going to concatenate on line 3 but decided to look for the main problem first. bloxxyz 274 — 10y
0
I believe the parameter is the problem. If you're not adding "Plr", then it's not needed. TheReapersComing 0 — 10y
0
Makes sense, but didn't quite work. I've tried removing the parameter and it didn't change anything. :/ bloxxyz 274 — 10y
0
Oh that's the problem, you need to insert it into playergui. TheReapersComing 0 — 10y

Answer this question