Output reads: attempt to index function with 'Play' what is the problem?
Asked by
3 years ago Edited 3 years ago
I'm trying to make an animation play as shown in the function however, the outputs always prints out an error: attempt to index function with 'Play' which is the :Play() part I don't seem to know what is causing the error and how to fix it.
1 | local character = player.Character or player.CharacterAdded:Wait() |
2 | local humanoid = character:WaitForChild( "Humanoid" ) |
4 | local animationid = game.ReplicatedStorage.Animation |
5 | local animation = humanoid:LoadAnimation(animationid) |
7 | local function animation() |