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

Simple Script won't work?

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

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

2 comments

0

that's what i had at first but that didn't work either

0

PlayerAdded does not connect before the player joins in an offline simulation. It works online.

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)

1 comment

0

I Tried it and i don't know why this solution didn't work :(

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