Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] Printing 1 Clicks everytime i click ?

Ok so i tried this very simple code but it doesn't work, when it prints the number of clicks, it saying "1 clicks" everytime i click the button here is the code :

local clicks = 0

script.Parent.MouseButton1Click:Connect(function()
	clicks = clicks +1
	print(clicks.." Clicks")
end)

Also there is no errors on output (I putted it on a localscript so that it's only counting how much the player clicked the button) I tried putting the number of clicks in a numbervalue then printing the numbervalue but same issue

1 answer

✓ Accepted answer

try this :

u had to set a comma by the print statement

``

local click = 0

script.Parent.MouseButton1Click:Connect(function()

click = click + 1
print(click,"clicked won time ") -- here have been changed  now it would work

end)

``

i hope this will work for you

insert in your button a localscript and set the code what here up is

2 comments

0

same problem

0

i fixed it, i just needed to put it in a different localscript

This discussion is preserved as it was. New answers, comments, and votes are closed.