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

How to make it work?

I want that if a player joins and his name is rinus17 , He'll get some tools in his backpack automaticly This is a script which is in workspace.

Player = game.Players.LocalPlayer

function Added(Player)
	if Player.Name == "rinus17" then
		game.Lighting.Emi:clone().Parent = Player.BackPack
	end
end

game.Players.PlayerAdded:conncet(Added)

1 comment

0

what isnt working?

1 answer

✓ Accepted answer
function Added(Player)
    if Player.Name == "rinus17" then
        local emi = game.Lighting:WaitForChild("Emi")
	emi:Clone().Parent = Player:WaitForChild("Backpack")
	emi:Clone().Parent = Player:WaitForChild("StarterGear")
    end
end

game.Players.PlayerAdded:conncet(Added)
  1. Problem is you had the localplayer which you didnt need.
  2. Just make sure this is in a normal script and inside either Workspace or ServerScriptStorage.
  3. Make sure that the Emi is inside Lighting.
  4. Other than that you should be good.

Hope this helped and please +1 and accept answer.

  • NinjoOnline

5 comments

0

It tells me that Backpack isn't a valid member of Player

0

EDIT, I editted. Try now and it should work

0

Thanks a lot.

0

Question, if I want the player to spawn with the tools after he respawns too, do I have to delete the function and add Player = game.Players.LocalPlayer?

0

no, I have re-editted my script, so that way when they die they will still have those tools on them

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