Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

cant play an animation, any help?

Asked by
Ali_MTR 30
12 days ago

so i made a textbutton that when i click at it, it does the animation

local player = game:GetService("Players").LocalPlayer
local character = player.Character
if not character then
    character = player.CharacterAdded:Wait()
end

local humanoid = character:WaitForChild("Humanoid")
local button = script.Parent

local animationid = 'rbxassetid://491426316' 

local animation = Instance.new("Animation")
animation.Parent = character
animation.AnimationId = animationid
local LoadAnimation = humanoid:LoadAnimation(animation)

button.MouseButton1Click:Connect(function()
    print("lol")
    LoadAnimation:Play()
end)

i've tested if the humanoid is not nil and it isnt and also tested if the event really works with printing "lol" and it does print it.

0
also its a local script Ali_MTR 30 — 12d
0
Is this in your own game? boomboomsha 397 — 12d
0
no, its in a group Ali_MTR 30 — 12d
0
also there are no errors Ali_MTR 30 — 12d

Answer this question