Is it a bad practice to use PlayerAdded just to get the Player from a ServerScript?

Is it a bad practice to use PlayerAdded just to get the Player from a ServerScript?

Are you able to show the snippet of your code you may be worrying about? The answer is no and im not sure how else youd do it, but I guess it could depend on your scenerio.

Basically, I’m trying to implement the buying system on the Server.

I’m not implementing it on the client because it would be easily exploitable, so I’m using PlayerAdded in ServerScripts just to get the player and make changes to it, and also to access PlayerGui and reference UI stuff.

“Is standard practice bad practice”

1 Like

Clearly if he knew it was standard practice he wouldnt be asking if it was bad or not :confused:

Yes, if you want to detect when a player joins the game this even is standard

This is kinda stupid and off-topic, I know, but what does standard mean in this context?

Because using PlayerAdded is one of the most common ways to get the player on the server. Also it’s fine to edit guis on the client but important transactions on the server. EX:
If the player is buying a car, you detect the button click on the client and then check on the server if they have enough money. If they do change a text label on the client to show “Purchased”

1 Like

What if I want to increase an IntValue? I’m currently doing it on the client. Should I do it on the server? Should I do it with a RemoteEvent or with a completely new ServerScript?

Changing it means increasing the value of rebirths on the leaderstats, which is unfair.

Definitely change it on the server. Exploiters can mess with it a lot if you do this on the client

1 Like

With a RemoteEvent or a completely new ServerScript?

Depends on how you are handling it. If it requires action from the client first use a remote event else do it on the server

1 Like

Thanks for your help! I do appreciate it.

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