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

Unable To Cast Value To Object?

Asked by 4 years ago

I'm trying to make an Overhead smash animation play whenever you press "E" but I'm getting this error?

Script

local human = script.Parent:WaitForChild("Humanoid")

local AttackArm = true

local canattack = true

game:GetService("UserInputService").InputBegan:connect(function(input, gamepor)
    if (input.KeyCode == Enum.KeyCode.E or input.KeyCode == Enum.KeyCode.ButtonY) and canattack then 
        canattack = false
        script.RemoteEvent:FireServer(AttackArm)
        human:LoadAnimation(AttackArm, script.Smash):Play()
        wait(0.6)
        AttackArm = not AttackArm 
        canattack = true 
    end 
end)
2
I'm pretty sure LoadAnimation doesn't take a boolean as the argument to its parameter? DeceptiveCaster 3761 — 4y

Answer this question