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

How Do I make a tool drop where the player stands on equipped?

Asked by 8 years ago

I Made a health pack tool but i just need it to drop on the ground when you equip it. any help?

local p= game.Players.LocalPlayer
local tool= script.Parent
function equipped()
wait()
-- what will i put here for it to drop
end
tool.Equipped:connect(equipped)

1 answer

Log in to vote
0
Answered by 8 years ago

since there is no method for making a tool de-equip, we just need to assign the tool's parent. Usually when a player manually de-equips a tool, it will go to the workspace!

local p= game.Players.LocalPlayer
local tool= script.Parent
function equipped()
    wait()
    tool.Parent = game.Workspace --Removes the tool from the player and places it in the workspace
end
tool.Equipped:connect(equipped)

0
Yea But i want it to drop where the player stands xShadowNight 20 — 8y
0
@xShadowNight. It automatically does. It's position is the same no matter what parent it is assigned. I tested it so it should work! minikitkat 687 — 8y
0
It doesn't work with me... sorry i must be a pain xShadowNight 20 — 8y
0
Okay, let's go through a check list, Make sure that your tool contains a part labeled 'Handle'. If there are more than one parts, make sure they're welded. And please make sure that the script is a 'Local Script' and not a normal script. Hope this helps! minikitkat 687 — 8y
View all comments (2 more)
0
Yea its drops where it was in the workspace, not where the player was handling it xShadowNight 20 — 8y
0
Okay, I tested it several times in different scenarios. It does work. Can you screenshot your explorer so I can help you further. My guess is that you don't have a part named Handle in the tool. But I could be wrong. minikitkat 687 — 8y
Ad

Answer this question