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

How do I replace the slash animation with my own?Please Help!

Asked by 1 year ago

Im trying to change the animations, but I don't know how.

the id of keyframesequence: 10123018321

Script:

local tool = script.Parent
local canDamage = false



local function onTouch(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
    if not humanoid then 
        return 
    end


    if humanoid.Parent ~= tool.Parent and canDamage then 
        humanoid:TakeDamage(400)
    else
        return
    end


    canDamage = false
end



local function slash()
    local str = Instance.new("StringValue")
    str.Name = "toolanim"
    str.Value = "Slash" 
    str.Parent = tool
    canDamage = true
end



tool.Activated:Connect(slash)

tool.Handle.Touched:Connect(onTouch)

Please Help!

2 answers

Log in to vote
0
Answered by 1 year ago

Make your own in the animation editor, then replace it with your animation id.

Ad
Log in to vote
0
Answered by 1 year ago

You would need to rewrite this function, right now it uses some function that roblox has which I believe detects when an object named "toolanim" is created. Instead of using this, value u can make the character play an animation here. I recommend you rescript the tool so the animations and tool work properly.

local function slash()
    local str = Instance.new("StringValue")
    str.Name = "toolanim"
    str.Value = "Slash" 
    str.Parent = tool
    canDamage = true
end
0
wat xGlacier101x 9 — 1y
0
https://developer.roblox.com/en-us/api-reference/class/Animation, use this to learn more about how to use animations. you would replace the slash function with the animation BulletproofVast 1033 — 1y
0
ok ty xGlacier101x 9 — 1y

Answer this question