How can I improve my shop system?

scripting

#21

This is nonsense unless you define _G.Ban somewhere, which you nor the OP does. Kicking the player should be fine for OP’s use case for simplicity’s sake. (they probably don’t want to ban players just for tripping a remote)

Absolutely not – you should use game:GetService(“ReplicatedStorage”). This will get the service regardless of what it is named. Never hardcode constraints of service names into your code, it will make it hard to unify with modules that assumes it is named differently and don’t use GetService. Code that uses GetService will always work regardless of how the services are named, you should teach yourself to use this rather than hardcoding the actual service name.

Besides, RStorage would be obfuscation over ReplicatedStorage. You shouldn’t shorten names just for the sake of having less to write, it makes your code harder to read.


#22

Instead of kicking / banning / doing nothing when an item isn’t found, maybe it should be logged
to google analytics or something as some kind of error. You could then check if it was a bug or an exploit, and if you really wanted to punish users, scare the user the next time they join by displaying a warning message that further cheating will result in consequences.


#23

I don’t know how to respond to this.
It is very much inconvinient having to login to an alt everytime you fail to hack a game.
Even if the top elite hackers magically never falsely triggered a remoteevent, majority of basic hackers will.

The function is selfexplainatory, as the owner is not a complete beginner I see no need to clarify any of it.


#24

In an open DevForum topic where everyone can see what you post, you should post so beginner scripters / developers understand it too.

In the future, people could wonder about the exact same thing, and could find this thread, and even though the question was the same, it was not explained properly, and was just a shot in the wild hoping people would understand.

I’m not trying to say that what you did was wrong, I completely agree with you that the code you provided is understable from a more intermediate scripter’s view.

That is why we google first, and ask after :wink:


#25

True, I added it to the original post.


#27

Somehow the variables were separated from each other. It was originally like how you organized it. Thank you, though.


#28

In my opinion you should replace the :Kick with just a simple return.