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

Creating local vs. server powerup items?

Asked by 6 years ago

I am confused a bit by creating scripted items, such as power ups. If I make a coin object in the workspace and add a script to it to increment a value in leaderstats (or other player stats) and then destroy the object once picked up, is it destroyed for all players or just the one that picked it up? How can I make sure that each player has an opportunity to pick up an item, such as a level completion reward or key for a door, but some that are first come first grab, it's removed for all players?

0
If you use a 'server' script to create the part then all players will see it. This goes for values you are increasing when using a server sided script. You would do all this inside in server side scripts. You don't have to use a local script at all. xPolarium 1388 — 6y
0
You would want to use a Local script when you want the client to see things like their points changing in a GUI. xPolarium 1388 — 6y
0
Just have a local script destroy the coin if you want it gone on the client. Use a script to destroy it if you want it gone for everyone. User#21908 42 — 6y
0
Use remote events/functions to communicate between server and client. User#21908 42 — 6y

Answer this question