How do I send values from the server to client?

The title explains what I am trying to do

2 Likes

You’re looking for a RemoteEvent or a RemoteFunction (also related is UnreliableRemoteEvent). These can be used to send data from server to client(s), or vice versa. Here’s an overview of Remote events and callbacks.

3 Likes

doesn’t work
filler text erererere

Could you possibly explain a bit more what exactly “doesn’t work”? Are you seeing any errors in the output? What does the code you’re using look like?

2 Likes

tbh i have already deleted all of the code because i gave up

Is the place saved? If yes, you can bring the code back

I didn’t save
filler text ererere

1 Like

As already mentioned, the best way to pass information between the client/server is through RemoteEvent and RemoteFunction. Their functionalities are exclusively for this.

dude i know how remoteEvents work, I’m saying it isnt letting me pass values from the server to client using them

You can. You just need to write like this:

On server:

RemoteEvent:FireClient(thePlayer, theValuetoSend)

On client:

RemoteEvent.OnClientEvent:Connect(function(theValue)
    print(theValue) --this will print what you put on server
end

Make sure the remote event is parented under replicated storage or it won’t work!

yeah… that is what i tried and it didn’t work

And the remote event is under replicated storage?

It WAS, but as previously stated, I already gave up and deleted all of the code

Hmm. Okay then. If you still had the code, I could help you further. Good luck!

Were there any errors by the way?

Yes
filler text erereererereererererere

Ok. What did the error message say?

idk
ererererererererereererererereer

Ah. Alright. Then there really is nothing more I can do to help you.

I have recovered the code kinda (most of it at least)