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

my FireClient script doen't work with remoteEvent doen't work, why?

Asked by 6 years ago

I make an animation stuff and I need fire client, I made it, but when it runs it does error.

-- in script

game.ReplicatedStorage:FindFirstChild("Events"):FindFirstChild("PunchAnimation"):FireClient(r6Ids, r15Ids, character, punched, punchWaitTime)

-- in local script

game.ReplicatedStorage:FindFirstChild("Events"):FindFirstChild("PunchAnimation").OnClientEvent:Connect(function(r6Ids, r15Ids, character, punched, waitTime)
    if character.Name == player.Name and character:FindFirstChild("Torso") then
        print("passed test")
        local animation = AnimationLoader(character.Humanoid, r6Ids[math.random(#r6Ids)])
        wait(waitTime)
    --  animation:Stop()
        print("stopped punching")
    elseif character.Name == player.Name and character:FindFirstChild("UpperTorso") then
        print("passed test")
        local animation = AnimationLoader(character.Humanoid, r15Ids[math.random(#r15Ids)])
        wait(waitTime)
    --  animation:Stop()
        print("stopped punching")
    end
end)

it makes error like this: Unable to cast value to Object

Why and how to fix that? Please help.

0
The first argument of FireClient must be the player Amiaa16 3227 — 6y
0
what first arguement sahar1213 72 — 6y
0
What is r6Ids. If it is not a player you can't make it the first argument of :FireClient(). SummerEquinox 643 — 6y

Answer this question