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?
Hi DaWarTekWizard,
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.)
Thank you,
Best regards,
~~ KingLoneCat