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 put a specific tool into players?

So i want to put a specific tool into players but how would i do that

this is what i got:

for i,v in pairs(game.Players:GetChildren()) do 
	if (v:IsA("Key card")) then 
	v.Parent = game.Players.LocalPlayer.Backpack
	end
	end
	wait(0.5)

4 comments

0

Would this be to all players

0

No this is just for local players

0

and v in that case is a player and nothing else and the script needs to be server sided for when a character is added if its not for everyone, if its for everyone then just put in starterpack

0

I don't understand this, is this for a player when they join in. Also is there any other script

2 answers

Put the item in StarterPack which you want every player to have, and when they join they will get given whatever you put in StarterPack. You are over complicating it.

Hi, there are several problems with your existing script, first its a local script which makes the tool invisible to others & and since it is there is no use for using i, v in pairs(). Second of all, you do if (v:IsA("KeyCard")) then. There is no roblox part called KeyCard, you would have to use "if v.Name == "KeyCard" then. Third of all, a tool cant be a member of players So do this and it should work

local keycard = game.Workspace.Keycard
for i, v in pairs(game.Players:GetChildren()) do 
if v:IsA("Player") then
keycard:Clone().Parent = v.Backpack
end
end

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