my FireClient script doen't work with remoteEvent doen't work, why?
I make an animation stuff and I need fire client, I made it, but when it runs it does error.
03 | game.ReplicatedStorage:FindFirstChild( "Events" ):FindFirstChild( "PunchAnimation" ):FireClient(r 6 Ids, r 15 Ids, character, punched, punchWaitTime) |
07 | game.ReplicatedStorage:FindFirstChild( "Events" ):FindFirstChild( "PunchAnimation" ).OnClientEvent:Connect( function (r 6 Ids, r 15 Ids, character, punched, waitTime) |
08 | if character.Name = = player.Name and character:FindFirstChild( "Torso" ) then |
10 | local animation = AnimationLoader(character.Humanoid, r 6 Ids [ math.random(#r 6 Ids) ] ) |
13 | print ( "stopped punching" ) |
14 | elseif character.Name = = player.Name and character:FindFirstChild( "UpperTorso" ) then |
16 | local animation = AnimationLoader(character.Humanoid, r 15 Ids [ math.random(#r 15 Ids) ] ) |
19 | print ( "stopped punching" ) |
it makes error like this:
Unable to cast value to Object
Why and how to fix that? Please help.