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

how do I change the idle stance for a tool?

Asked by
Elixcore 1337 Moderation Voter
6 years ago

so i have this sword i built and put a lot of effort into and i would like it to have it's own special animations, how do i change it's idle animations so when i have the sword equipped it will stay in a certain position?

1 answer

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago

Well if your talking about sword positioning then just change ToolGrip property of the tool. For an easy way to change ToolGrip use this plugin: https://www.roblox.com/library/174577307/Tool-Grip-Editor-Plugin However if you are talking about Idle Animations for your sword etc then do this. This is FilteringEnabled: Script - In ServerScriptService

local swordEquip = Instance.new("RemoteEvent" , game.ReplicatedStorage)
swordEquip.Name = "SwordEquip"

swordEquip.OnServerEvent:Connect(function(player)
    local char = player.Character
    local hum = char.Humanoid
    hum.Running:Connect(function(speed)
        local anim = Instance.new("Animation")
        if speed <= 0 then
            anim.AnimationId = "rbxassetid://12345" --Change 12345 to animation id for idle animation
            local animTrack = hum:LoadAnimation(anim)
            animTrack:Play()
        elseif speed > 0 then
            anim.AnimationId = "rbxassetid://12345" --Change 12345 to animation id for running animation
            local animTrack = hum:LoadAnimation(anim)
            animTrack:Play()            
        end
    end)
end)

LocalScript - In Tool

local tool = script.Parent

tool.Equipped:Connect(function()
    game.ReplicatedStorage.SwordEquip:FireServer()
end)

Hope it helped :D Mark this answer as answered if it answered your question

0
thank you a lot man! Elixcore 1337 — 6y
0
Np :D DumbKickButt5588 167 — 6y
0
ik this is really late and will mostly not get replied to but how do you get it to stop when you unequip it? ShineBright2775 30 — 4y
Ad

Answer this question