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

How do I make the handle from a tool not fall after equipping it?

Asked by 3 years ago

Every time I equip the tool, the handle or part falls for a sec and then goes to where its suppose too.

https://gyazo.com/f136530224aa3bfc9404670b64304dd7

LocalScript

local tool = script.Parent
local player = game.Players.LocalPlayer
local char = player.Character


tool.Equipped:Connect(function()
    game.ReplicatedStorage.Events.TestEvents.ConnectM6D:FireServer(tool.BodyAttach)

end)

tool.Unequipped:Connect(function()
    game.ReplicatedStorage.Events.TestEvents.DisconnectM6D:FireServer()
end)

ServerScript

local tool = game.StarterPack.Shovel
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://7353018496"
local PlayAnim
local M6D




game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local M6D = Instance.new("Motor6D", char.Torso)
        M6D.Name = "ToolGrip"

    end)
end)

game.ReplicatedStorage.Events.TestEvents.ConnectM6D.OnServerEvent:Connect(function(player, location)

    local char = player.Character   
    PlayAnim = char.Humanoid:LoadAnimation(anim)
    PlayAnim:Play()
    local body = tool.BodyAttach
    char.Torso.ToolGrip.Part0 = char.Torso
    char.Torso.ToolGrip.Part1 = location

end)

game.ReplicatedStorage.Events.TestEvents.DisconnectM6D.OnServerEvent:Connect(function(player)
    player.Character.Torso.ToolGrip.Part0 = nil
    player.Character.Torso.ToolGrip.Part1 = nil
    PlayAnim:Stop()


end)

1 answer

Log in to vote
0
Answered by 3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

Weld the tool together with WeldConstraints.

0
This answer should be in the comments. MarkedTomato 810 — 3y
0
You should only make it as an answer when you need to add code. But for this case it's just 1 sentence. MarkedTomato 810 — 3y
0
Sorry haha, I'm super new to scripting helpers. I'll keep that in mind next time. CoopGaming7 20 — 3y
0
big ups 360gamer107 6 — 3y
Ad

Answer this question