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

When the tool is given, it automatically equips. What do I do to it doesn't equip?

this is the script i am using (local script inside a tool(this tool is supposed to give another tools and it does, but the problem is the auto equip)

local Tool = script.Parent;
local player = game.Players.LocalPlayer
local SasukeClassicShirt = game.ReplicatedStorage.Clothes.SasukeClassicShirt:Clone()
local SasukeClassicPants = game.ReplicatedStorage.Clothes.SasukeClassicPants:Clone()
local SasukeClassicFace = game.ReplicatedStorage.SasukeClassicFace:Clone()
local jutsu = game.ReplicatedStorage.Jutsus.SasukeClassic:Clone()  ---- The Folder where the tools are
  
Tool.Equipped:connect(function()
player = script.Parent.Parent
player.Humanoid.MaxHealth = player.Humanoid.MaxHealth + 9999999
player.Humanoid.Health = player.Humanoid.MaxHealth
player.Shirt:remove()
SasukeClassicShirt.Parent = player
player.Pants:remove()
SasukeClassicPants.Parent = player
player.Head.face:remove()
SasukeClassicFace.Parent = player.Head
jutsu.Chidori.Parent = script.Parent.Parent ---- Tool 1
jutsu.CurseMark.Parent = script.Parent.Parent ---- Tool 2
jutsu.CurseMark2.Parent = script.Parent.Parent ---- Tool 3
jutsu.Fireball.Parent = script.Parent.Parent ---- Tool 4
local SSJHair = game.ReplicatedStorage.SSJHair:Clone()
SSJHair.Parent = player
SSJHair.CFrame = player.Torso.CFrame
local Weld = Instance.new("Weld")
Weld.Name = "SSJ"
Weld.Parent = player.Head
Weld.Part0 = player.Head
Weld.Part1 = SSJHair
Weld.C0 = CFrame.new(0.05, 0.5, 0.4) * CFrame.Angles(0,math.pi,0)
Weld.C1 = CFrame.fromOrientation(0, -179.2, 0)
Tool:Destroy()

end)

1 comment

0

Why are you using remove for shirts and pants but Destroy for tools remove is deprecated you should use destroy() also dont forget to indent it can make your codes a lot cleaner unless ur weird and you like it this way your whole code needs to be reconstructed

1 answer

The active tool is currently a child of the character. You need to assign your new tool's parent to the backpack.

newTool.Parent = player.Backpack

From the tool instance description:

Equipping a tool moves it from the Backpack and into a player’s character model in the Workspace.

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