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

How would I make a click to get something simulator?

My game isn't released so I'll just say u get something every time u click. I'm worried that the remote events will get throttled if I keep firing remote events. Will that happen and then delay lag will happen? I haven't tested it yet but I have 10 players as max. I do know how to code it but will firing remote events everytime cause lag?

1 answer

✓ Accepted answer

To answer your question, yes, firing remote events excessively will cause lag. Especially if one of your players decides to use an auto clicker. gasp

Anyways, you can get around this by doing everything that you would normally do when a player clicks, except store a value for the amount of times a player clicked. Then, have a while wait(1) do loop which checks if the clicks > 0, and if they are, fire your remote event.

This limits the amount of remote events fired by a single player due to clicks to 1, and the total of the server to 10. Which should not cause lag.

I also recommend calling math.min(clicks, 12) on the server when it receives the clicks, because the chances of a player clicking more than 12 times without an autoclicker is unlikely. I used to do badlion pvp on Minecraft, and maxed out at around 13-14.

3 comments

0

AAAAY u do minecraft pvp too? but that doesn't feel too secure

0

What do you mean it doesn't feel to secure?

0

ohhhhh u shoulda told me to change it locally and loop it to match the server so it feels smooth but anyways u gave me the loop idea so th

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