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

How do I force the player to equip a tool on spawn?

I've tried this:

local copy = game.Workspace.Tool:Clone()
copy.Parent = game.Players.Player1.Backpack

But it gives me an error saying "Player1 is not a valid member of Players" which I tried to fix by using:

local copy = game.Workspace.Tool:Clone()
copy.Parent = game.Players.TheRealJMHacker.Backpack

But it gives me the same error except my name replaces "Player1"

4 comments

0

use player added

0

and humanoid.died or just put it in the starter pack

0

Just saying, you would get the player by saying this "game.Players.LocalPlayer.Backpack". "Player1" is looking for someone named "Player1" :L

0

ohhhh, thx

2 answers

Just replace "Tool" with the name of the tool in the player's backpack. This will put the tool into the character which makes the player equip it.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		plr.Backpack.Tool.Parent = char
	end)
end)

3 comments

0

so you're saying, if my tool is named "poop" all i have to do is to relace "Backpack.Tool.Parent" with "Backpack.Poop.Parent"?

0

Yes assuming that "poop" is in backpack

0

where do i put this script and is it local script or just a script

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