You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I would like to ask questions whether this is good or very bad.
What is the issue? Include screenshots / videos if possible!
My issue is that I lack knowledge.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I couldn’t see to find any similar.
Okay so, I would like to ask a simple question
The script shown below, would it not cause problems to my game if I have similar scripts like these in different scripts?
For example, I could have a similar script shown below in 5 different scripts, would these not cause problems or lag?
local run = game:GetService("RunService")
local click = false
run.Heartbeat:Connect(function()
if click == true then
frame.Size = Udim2.fromScale(depends, depends)
click = false
end
end)
I know it’s a simple question, but it’s a big issue for me, thank you very much for responding!
Loops are inefficient since its basically running the same script over again when you’re not even clicking, which is why using InputBegan is more efficient, it only runs the code when the game registers an input (like a click in this case).
How do you know his “click” is meant for clicking, he didn’t provide that. A loop will only work if the value is true or false, just like he wants it to
The variable is clearly named “click”, and it seems like a ui tweens when the variable is set to true, what else would you expect for the variable to be used for?