Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When should you use :FireServer() and when should :FireClient() be used?

Im trying to convert a custom name script. It's an on-screen button that you click, and it should give you a name. That name should be seen by other players. However, im trying to convert it into FE. Should i use :FireServer() or :FireClient()?

2 answers

✓ Accepted answer

Welcome,

There are several types of :Fire things that might help you, I will describe you what each one do so you can choose your the most suitable one for your case:

  1. When you have a local script you need use :FireServer() because local scripts work on client side.

  2. If you got a server script and you want a specific client to do something you need to use :FireClient(player). This will fire the client of the mentioned player in the brackets.

  3. If you want to fire all clients you can use :FireAllClients() this will fire all the clients in your server.

To perform all the above you'll need a RemoteEvent if you don't have one already. You can read more about RemoteEvents over here: https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events

Since you haven't mentioned what kind of script you are using to detect the click on the button I can't tell you which one you should use.

If you got any further questions please respond so I will be able help you.

Have a nice day :D

2 comments

0

Im using a LocalScript.

0

Depending on what script you are using to fire, you use the opposite. If you are on a local script you use :FireServer() and :FireClient() or :FireAllClients() with a server script.

FireClient is Server to Local and FireServer is Local to Client. I think you should use :FireServer to do that.

Please accept my answer if you find this helpful.

-MajinBluee

This discussion is preserved as it was. New answers, comments, and votes are closed.