When size is more then 20 its supposed to print("Over 20") why isn't it working? When it is over 20 it doesnt do anything instead the value of size keeps going.Test it and you will see
player = script.Parent.Parent
char = player.Character
mouse = player:GetMouse()
hold = false
function keydown(key)
key = key:lower()
if key == "z" then
hold = true
bricksize()
end
end
function bricksize()
size = 0
if size > 20 then
hold = false
print("OVer 20")
end
while hold == true do
wait()
size = size+1
print(size)
end
end
function keyup(key)
key = key:lower()
if key == "z" then
hold = false
end
end
if hold == false then
size = 0
end
mouse.KeyDown:connect(keydown)
mouse.KeyUp:connect(keyup)

2 comments
Nothing changed
Weird, when I tested it reached 21 then said"OVer 20" and did not continued. Did you have it in StarterGui?