Am I blind or is this a Roblox bug?

? when a player resets, all code is cloned and reset-ed as well

1 Like

Correct

Characters Characters Characters

1 Like

No, the script is in the playerscripts, so it doesn’t reset, however when a player respawns then the UI resets. I can try changing this, but I don’t think it would make a difference.

1 Like

Oh, ok then. I suggest, if you can, put the script inside the UI, or just put the while loop outside the function that way at least that won’t cause much of an issue.

1 Like

put the script into player GUI. It needs to always respawn with GUI (since it’s manipulating GUI).
otherwise, you can clone it to player gui?

doing so would solve many inconveniences

1 Like

Actually, just re-assign the variable when the function is called. I’ve had that issue occur many times before. But still, put the loop outside the function.

1 Like

Ok sure no problem, I will also say, that these are all fired when the UI is reset so there isn’t any waiting, so putting outside wouldn’t really change anything from that perspective
image

1 Like

Yes that is what I do

1 Like

I just tried it out, and I forgot, the loop has to go into a function because, once it is leftMouse is false, the loop stops and won’t run again even if leftMouse is true again because the code has already moved to the next line.

1 Like

I’m not sure if the variables get updated once called from a function, but I suggest trying to update it within the function that calls the buttons.

You should also change it to a RenderStepped event, here’s one that checks if leftMouse == true, so that it doesn’t move on after it is false.

local rs = game:GetService("RunService").RenderStepped:Connect(function()
    if leftMouse == true then
      --do stuff
    end
end

Yes this is what happens

I will try the renderstepped, also very silly of me I could have just put the if statement inside the whole loop and it wouldn’t have that issue.

1 Like

Oh, so the issue was the buttons not updating?

No, I am saying yes the variables are updated inside the function that calls the buttons.

looks like a UI issue to me try removing the background UI and see if the problem persists.

1 Like

We put the UI at the front most part of all the other screens, and tried putting them by themselves in a separate place.

1 Like

Ok, I just tried this, and I still seem to be getting the same issue

1 Like

you might have to completely rewrite your control script here:

perhaps the system causes these inconveniences? cause normally, you don’t need that leftOff() function…

You might want to look into the touch events (TouchLongPress, TouchTap), they might solve this problem. You could also look at the x and y parts of the input with input changed the make sure it’s within the borders of the button. I recall there is also a module somewhere that fixes something like this.

Edit:

Here is that module:

Oops…

1 Like

Though the positioning axis is a cool idea, I will try it out.