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

Simple Script won't work?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

The point of this script is to put a model named "Animals" into every new player's "player". What is wrong with it?

function onPlayerEntered(player)

    local s = script.Parent:clone()
    s.Parent = game.Players.player
    end


game.Players.PlayerAdded:connect(onPlayerEntered)

2 answers

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

If you mean to write player instead of game.Players.player, change it to s.Parent = player.

0
that's what i had at first but that didn't work either Gwolflover 80 — 9y
0
PlayerAdded does not connect before the player joins in an offline simulation. It works online. 1waffle1 2908 — 9y
Ad
Log in to vote
-1
Answered by
u_g 90
9 years ago

Try using "ChildAdded", instead of "PlayerAdded".

function onPlayerEntered(player)

    local s = script.Parent:clone()
    s.Parent = game.Players.player
    end


game.Players.ChildAdded:connect(onPlayerEntered)

0
I Tried it and i don't know why this solution didn't work :( Gwolflover 80 — 9y

Answer this question