ok so, i am making a magnitude and when you are in that area a tween will play. Since this script is a loop i have to make a debounce so it only tweens once, but my debounce doesnt work so it still loops.
Can anyone see what is wrong with my debounce?
btw, this is not the whole script, just the part with the debounce!
local CanActive = true
local Mag = (v.Position - HumanoidRootPart.Position).magnitude
if Mag <= 6 and CanActivate then
CanActivate = false
EClip:TweenSize(UDim2.new(0, 120,0, 53),"Out","Bounce", .5, true)
print("Player is near Clothes")
else
CanActivate = true
print("Player is no longer near Clothes")
end

3 comments
Can you post the entire code, I cant find the error from this part
there is no error, the code just loops over and over, this code is inside a run.renderstepped function
I posted more from the script