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

animation never loads for sword?

Asked by
kiraca 0
2 years ago

so basically i am trying to make a pillow weapon but the animations never load. I tried multiple different ways to do it, including a click detector when attacking, i looked up a bunch of tutorials but none of them work. my friend made the animation and i created the game. I have them under the script but i just hold the tool like a block. this is an example of my click detector script:

local uIS = game:GetService("UserInputService") local click = script.Parent.ClickDetector

script.Parent.Equipped:Connect(function() local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) idle:Play() end)

script.Parent.Equipped:Connect(function(hit) click.MouseClick:Connect(function() local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) attack:Play() end) end)

and this is my script without the click detector:

local db = false

local canHit = false

local idle

local slash

local randomSlash = 1

local con = { damage = 5 }

script.Parent.Equipped:Connect(function() script.Parent.Handle.Equip:Play() local humanoid = script.Parent.Parent:FindFirstChild("Humanoid") if not idle then idle = humanoid:LoadAnimation(script.Idle) idle:Play() end end)

script.Parent.Activated:Connect(function() if not db then db = true

    local humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
    if not slash then
        if randomSlash == 1 then
            slash = humanoid:LoadAnimation(script.Slash1)
            randomSlash = randomSlash + 1

        elseif randomSlash == 2 then

            slash = humanoid:LoadAnimation(script.Slash1)
            randomSlash = randomSlash - 1
        end
    end
    slash:Play()
    wait(.2)
    script.Attack:Play()
    wait(.8)
    if slash then
        slash = nil
        db = false
    end
end

end)

1 answer

Log in to vote
0
Answered by 2 years ago

Okay so basically i'm pretty sure it doesn't have to do with scripting but i'll answer anyways. So since your friend made the animation tell them to go back to it and press the three dots on the left side top corner [this is roblox studio animator by the way so if its not made in that i dont know] and then go to animation priority and set it to movement.

0
k so it worked but i made another weapon and this one wont load as well, i put the priority to action because its meant to be a weapon attack animation and it wont load kiraca 0 — 2y
Ad

Answer this question