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

My game is lagging when players click really fast?

Asked by 4 years ago
Edited 4 years ago

So basically ive been working on this game and whenever I click really fast my FPS drops and my ping spikes until I stop clicking. And it isnt just me, Players in my game also experience this and its making players stop playing. Im not the kind of person to ask for help, but I have been trying to figure something out for about a week now and at this point I need some answers. I dont even know where to start because if I join my game, and click really fast I lag for no reason. If anyone has expericned this or has a solution please let me know. Thanks!

0
What do the clicks cause, IE what action do they trigger, and how do they do it? The reason clicks lag the game is because there's probably a localscript somewhere that's listening for them and doing somthing really intensive (like maybe sending a large amount of data through a remoteevent). whenallthepigsfly 541 — 4y
0
You see thats the problem. If u click on nothing and just click really fast it causes lag. I tried disabling everything in the server script service and every thing in starter character/player scripts and the lag still happened. Phase_Venom 55 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

There is a really simple solution to this, use Debounce to limit the cps.

0
I wouldve of been done that but I dont know a way to detect if a player clicked. Phase_Venom 55 — 4y
0
Roblox has a event that detects when something is clicked for a mouse detector its MouceClick and for a button its a MouseButton1Click. https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseClick & https://developer.roblox.com/en-us/api-reference/event/GuiButton/MouseButton1Click. THUNDER_WOW 203 — 4y
Ad

Answer this question