#Help my R6 animation doesn’t work

1 messages · Page 1 of 1 (latest)

copper zodiac
#

local player = game.Players
local localPlayer = player.LocalPlayer
local Mouse = localPlayer:GetMouse()

local Equipped : boolean = false

function ToAnimate(AnimId : string)
    local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
    local humanoid = character:WaitForChild("Humanoid")
    local animator : Animator = humanoid:WaitForChild("Animator")

    local animation = Instance.new("Animation")
    animation.AnimationId = "rbxassetid://" ..AnimId
    
    print(animation.AnimationId)


    local track = animator:LoadAnimation(animation)
    track:Play()
    
    
end

function ButtonClicked(RemoteEvent : RemoteEvent, Bool : boolean)
    
    if Bool then
        RemoteEvent:FireServer()
        ToAnimate("119394546767563")
    end
    
end

function Equiped(RemoteEvent : RemoteEvent, Bool : boolean)
RemoteEvent:FireServer(Bool)

end

--97788697392928
return function(Tool : Tool)
    
    local Events : Folder = Tool:WaitForChild("Events")
    local Rev_EquipedEvent : RemoteEvent = Events:WaitForChild("EquipedEvent")
    local rev_ButtonClicked : RemoteEvent = Events:WaitForChild("ButtonClicked")
    
    print(Rev_EquipedEvent)

    Tool.Equipped:Connect(function()
        Equiped(Rev_EquipedEvent, true)
        Equipped = true
    end)
    Tool.Unequipped:Connect(function()
        Equiped(Rev_EquipedEvent, false)
        Equipped = false
    end)
    
    Tool.Activated:Connect(function()
        ButtonClicked(rev_ButtonClicked, Equipped)
    end)
    
    
    print(Tool)
end
#

I haven't written code in months, I don't remember how to play animations evilcat 😔

solid finchBOT
#

studio** You are now Level 10! **studio

dusky remnant
#

Hey there!

#

@copper zodiac

#

By animation, do u mean animations in general as in walking and idle, or other stuff like fighting animations?

copper zodiac
dusky remnant