Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make variables have values? (like money)

Asked by 5 years ago

so like everytime that something gets clicked it increases the value of a variable by 1. I just want to script about increasing value when ran I don't need Mouseclick:Connect script in it.

0
could you be more specific? megukoo 877 — 5y
0
Im guiding him through it, kinda like a tutorial. zandefear4 90 — 5y

3 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Gamer, not sure if you left the chat or not. So in the script, in the click detector, put this code:

1workspace.MyClickDetectorEvent.OnServerEvent:Connect(function(plr)
2    plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + 1
3end)

You can also delete the remote event, it wasn't necessary. Then you should be good! If you have a problem, comment on my answer, and put your code in your question. I should be able to help you. If it worked then, you can accept my answer, and good luck!

Ad
Log in to vote
0
Answered by 5 years ago
1local int = Instance.new("IntValue")
2int.Parent = workspace
3 
4int.Value = 4360875
Log in to vote
0
Answered by
zomspi 541 Moderation Voter
5 years ago

It can be as simple as this:

1local number = 1
2while true do
3number = number + 1
4wait(1)

Please accept this answer if I helped

Answer this question