#Remote not recieved on client

1 messages · Page 1 of 1 (latest)

ashen needle
#

Ok so first, i wanted to make a animation by firing into a player local script, Then The local script will recieve and play it, Now, the problem is it works and is actually recieved only half of the time, And if it does not work first time, then the following will not work, I've added delays, and print statement, Either the server is not sending event in the roblox remote hander sense, or the client is not recieving in the roblox sense, as I debug it using print statement the line before and after firing remote, and the line after reciving, some times only the server prints

CLIENT

game.ReplicatedStorage.Remotes.NCP.PlayAnimNPC.OnClientEvent:Connect(function(uid,name)
    print("PLAYING"..name)
    if workerArray[uid] == nil then return end
    workerArray[uid][4][name] = workerArray[uid][3][name]:Play()
    
end)

SERVER

local function moveWork(plr,uid,pos,cfg,obj)
    --print(WorkerArray)
    --print(WorkstationsArray)
    
    local path = game.PathfindingService:CreatePath(agentParameters)
    local success, errorMessage = pcall(function()
        path:ComputeAsync(WorkerArray[plr.UserId][uid][2], pos)
    end)
    --warn("C")
    task.wait(1)
    remotes.NCP.PlayAnimNPC:FireClient(plr,uid,"Walk")
    print("PLAYING WALK")
    task.wait(1)
    --warn("D")
    
ashen needle
#

This is getting stranger, Now the function sometimes recieves, but it doesn't add stuff to the table no error??

#

Image as the last two image

inland hedge
#

in this example it looks like this handles the walking animation of an npc...

what if you add an if statement where you have "warn(C)"
if success then ...(all of that stuff down there)

that way it should only fire when it succeeds in finding a path...

#

also make sure the parameters you're firing to the client aren't nil or the wrong ones by adding some checks (probably another if statement or whatever else you have in mind)

ashen needle
near matrix
#

does moveWork immediately get called after player joined?

#

u might called FireClient before the player even loaded