2DLAF
(Dan)
April 22, 2021, 4:39pm
1
Greetings
This probably has a very easy fix that I’m not seeing, but whenever I equip a tool in my game, the tool just falls and when I equip it, it spawns where the handle was before I put it in ReplicatedStorage and then it falls.
The Script:
function hi(x)
local y = x.Backpack
local z = game.ReplicatedStorage[“Burger Buns”]
z:Clone().Parent = y
end
script.Parent.ClickDetector.MouseClick:connect(hi)
Thanks.
2 Likes
Roblox has an easy to use function for equipping a tool using the Humanoid named EquipTool
An example of this implementation would be as follows:
local tool = toolPrefab:Clone()
tool.Parent = plr.Backpack
hum:EquipTool(tool)
2DLAF
(Dan)
April 22, 2021, 5:40pm
3
Does this solve my tool falling issue?
EquipTool properly handles the parenting and welding of the tool to the right hand or arm, so yes it should
2DLAF
(Dan)
April 22, 2021, 5:41pm
5
Okay! I will try this out now, I’ll see if it works.
Can you explain the tool model or provide an image.I’m speculating you have multiple parts that aren’t welded together
2DLAF
(Dan)
April 22, 2021, 5:42pm
7
Also, the script is
local Players = game:GetService(“Players”)
local player = Players:FindFirstChildOfClass(“Player”)
if player and player.Character then
local humanoid = player.Character:FindFirstChildOfClass(“Humanoid”)
if humanoid then
local tool = workspace:FindFirstChild(“Tool”)
if tool then
humanoid:EquipTool(tool)
end
end
end
Would anything break if I changed the ‘local tool = workspace’ to ReplicatedStorage?
2DLAF
(Dan)
April 22, 2021, 5:43pm
8
Will do that now, one second. Just need to try this script someone suggested,
RatiusRat
(Boopmaster)
April 22, 2021, 5:43pm
9
Does the tool have a handle? Because tools need handles.
1 Like
2DLAF
(Dan)
April 22, 2021, 5:44pm
10
And another thing, where would the script go?
2DLAF
(Dan)
April 22, 2021, 5:44pm
11
Yep, it has a handle, I tried it with and without a weld, didn’t work.
What is in the tool? I haven’t been able to confirm my speculations about there being multiple parts besides the handle of tool.
FriendWow
(FriendWow)
April 22, 2021, 5:46pm
13
Do you have a part called handle? If so then try setting the tool’s parent to the character of the player. Not sure if that’ll make a difference but that does work for me.
2DLAF
(Dan)
April 22, 2021, 5:48pm
14
Two unions, which is the actual tool, and one handle with nothing inside.
Are they’re any welded together for them to be able to stay together
2DLAF
(Dan)
April 22, 2021, 5:49pm
16
Make sure the Tool has a Part named “Handle” (case sensitive)
I see nothing keeping em together u can just weld it urself with weldconstraints or get a plugin
2DLAF
(Dan)
April 22, 2021, 5:50pm
19
I have added welds they don’t do anything, I also try changing the weld Part0 and Part1 properties and it doesn’t work.
2DLAF
(Dan)
April 22, 2021, 5:50pm
20
Should I add a weldcontraint to them all?