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

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

Asked by 6 years ago
Edited 6 years ago

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"

0
use player added abnotaddable 920 — 6y
0
and humanoid.died or just put it in the starter pack abnotaddable 920 — 6y
0
Just saying, you would get the player by saying this "game.Players.LocalPlayer.Backpack". "Player1" is looking for someone named "Player1" :L Cyprus_Alexander 10 — 6y
0
ohhhh, thx SmugNyan 24 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

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)
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"? SmugNyan 24 — 6y
0
Yes assuming that "poop" is in backpack martingalethreat 81 — 6y
0
where do i put this script and is it local script or just a script markdavidg 0 — 3y
Ad
Log in to vote
0
Answered by
thesit123 509 Moderation Voter
6 years ago

ROBLOX WIKI :D

Answer this question