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 4 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 — 4y
0
Im guiding him through it, kinda like a tutorial. zandefear4 90 — 4y

3 answers

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

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

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

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 4 years ago
local int = Instance.new("IntValue")
int.Parent = workspace

int.Value = 4360875
Log in to vote
0
Answered by
zomspi 541 Moderation Voter
4 years ago

It can be as simple as this:

local number = 1
while true do
number = number + 1
wait(1)

Please accept this answer if I helped

Answer this question