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

Animation works in playtest but doesn't load in actual gameplay? (Solved)

Asked by 3 years ago
Edited 3 years ago

I have a script that plays a custom holding animation when equipped, works how I want in playtest, literally nothing wrong while playtesting but when I play the game it doesn't work. I went to the console while in-game and it says the player doesn't have a humanoid or something?

btw this game wasn't made on a group so its not that i uploaded the animation to my profile but the game was made by a group

local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character
local Humanoid = Character:FindFirstChild("Humanoid")

local Animation = Humanoid:LoadAnimation(script.Animation)

script.Parent.Equipped:Connect(function()
    Animation:Play()
end)
script.Parent.Unequipped:Connect(function()
    Animation:Stop()
end)
1
try doing :WaitForChild() instead of :FindFirstChild() when setting the humanoid variable FirewolfYT_751 223 — 3y
0
THANK YOU! AllenBatman666 30 — 3y

Answer this question