Fired player from server to client. Client says nil?

Game logic for this script: I was trying to send a random player from a table to the client to notify the player that it’s their turn. But client always says nil. So after multiple failed attempts at rearranging the script, I decided to make the most simple script to see if the remote event is even working and it’s still erroring?? I don’t understand anymore.

edit1: Just FYI, I do have the scripts in the correct places. Local script in starterplayerscript and server script is in serverscriptstorage

This is the server script:
Screenshot 2024-08-05 145547

This is the client:
Client

And this is the output in the game:

When running RemoteEvent:FireClient, the first parameter will be which player the server should fire to. Looking at your code I would assume you would want to use RemoteEvent:FireAllClients instead.

1 Like

Thanks. I tried firing FireClient(player, randomPlayer) before and it wasn’t working because it was the “player” variable and not the specific player that I’m trying to send the info to. Changed it to FireClient(randomPlayer, randomPlayer) and it worked. Thanks again, you helped me realize my mistake.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.