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

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

Asked by
Talveka 31
5 years ago

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

Log in to vote
0
Answered by
yoavstr 52
5 years ago

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

0
Im using a LocalScript. Talveka 31 — 5y
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. Audiimo 105 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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

Answer this question