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

Make a tool unanchored/ have no grip?

Asked by 6 years ago

I basically want the tool to be unanchored/have no grip when I equip it so it falls to the ground on equipped. I messed with tool properties and found no way to do this. Am I doing something wrong?

0
Do you have any script?Or screenshot?Have you tried messing with the parts' properties? KawaiiX_Jimin 54 — 6y
0
Yes, I've messed with properties. Is there something I'm missing? DaWarTekWizard 169 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Hi DaWarTekWizard,

I was just messing around with this on studio and figured out how to make it to where the Part falls to the ground when you equip the tool. First, I used a local script and connected the .Equipped event with a function of my own to activate the falling action upon Equipping the tool. Anyways, make sure you customize the script that I am going to show you as an example because you need to name the Part something specific. I called it Handle because that's what you need to name a Part under a tool if you want the tool to have a Handle. If you name it something different, make sure you change it in the script as well or it won't work. Anyways, let's just jump to the script and I will explain each line.

local tool = script.Parent; -- The tool.
local part = tool:FindFirstChild("Handle"); -- The part that will be falling to the ground.
local players = game:GetService("Players"); -- The players service.
local player = players.LocalPlayer; -- Local Player, as in the player that has the tool.

tool.Equipped:Connect(function() -- .Equipped event being connected to an anonymous function.
    local char = player.Character or player.CharacterAdded:Wait(); -- Character of the Player.
    local torso = char:WaitForChild("UpperTorso") or char:WaitForChild("Torso"); -- Torso of the player

    if part then -- If statement checking if the part is under the tool, this is necessary because I am going to remove the part from the tool and place it in the workspace to project the falling effect.
        part.CanCollide = true; -- Makes the Part's CanCollide property true, which allows for it to Collide with other parts.
        part.Anchored = false; -- Unanchores the part.
        part.Parent = workspace; -- Makes the part workspace so that it can project the falling of the object.
        part.CFrame = torso.CFrame * CFrame.new(1.5, .5, -2); -- Sets this specific CFrame so that it looks like you just equipped it and it fell from where you equipped it. Rather than just teleport to the ground.
    end -- end for if statement
end) -- end for Anonymous Function.

(P.S. After this function runs, you won't be able to do the same tool's falling action again because the part's out of the tool. In order to re-do it, you're going to need to put it back into the tool upon Un-Equipment, but, I didn't make that because you didn't provide details about wanting to learn that.)

Well, I hope I helped and have a nice day/night!

Thank you,

Best regards,

~~ KingLoneCat

0
TYSM! DaWarTekWizard 169 — 6y
Ad

Answer this question