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

How should i do that if someone touch a TextButton it will give at the player 0-100 money?

Like when someone touch that TextButton it will give 0-100 money i don't know how to do it so. can someone help me??

Thanks.

2 answers

Can’t give you the script just like that, but I will give you a push in the right direction.

--LocalScript under TextButton

local button = script.Parent 

button.MouseButton1Click:Connect(function()
    -- Do code
end) 

You will need a IntValue or NumberValue in a player to store the money, and that is usually kept in a folder called "leaderstats", in the player. . You will have to use math.Random(1,100) to generate the number (if you want decimals it will be different), then set the value. That code would go in Incapaz's script.

If you need more information on them:

IntValues

NumberValues

Random Numbers

If you do not know how to even define the variables, I recommend using the Wiki and youtube videos as tools.

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