It says that on line 9, it is unable to cast a value to the object, and i have no idea what to do about it, and also the remote event i put in immediately fires when you join the game, and i have no idea how to code it since I'm a horrible coder. Please help.
local rep = game:GetService("ReplicatedStorage")
local PunchEquipped = rep.PunchEquipped
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local tool = script.Parent
local Animation = "https://web.roblox.com/library/10336312893/Fist-Animation"
local PlayAnim = Animator:LoadAnimation("Animation")
if tool.Equipped then
PunchEquipped.OnServerEvent(Animation)
if Player == tool.Parent then
print('Tool is equipped')
Animation.AnimationPriority = Enum.AnimationPriority.Action
Animation.AnimationID = "https://web.roblox.com/library/10336312893/Fist-Animation"
Animation.Parent = Character
PlayAnim:Play()
end
end
Unable to cast value to Object - Client - LocalScript:9

4 comments
Animations will still show to others if played locally, roblox handles player animations via a local script called "Animator". The requirement of a Server sided script for animations is if your animating a non-player character. Or not the local character.
Still wont work. I put them in their correct places, there is no errors in the output, but the animation doesn't play.
Wait, I forgot to make the animation id a real Animation.
Fixed it. Well thanks for the info Protogen but i'm playing the animation in the server just in case.