Like of their cash reaches 20 they get a sword and if it reaches 50 they get. Magic. (Btw i have a cash auto. Riser )
Example: This is for 'SHOP'
01 | player = script.Parent.Parent.Parent.Parent.Parent |
02 |
03 |
04 | local tool = game.ServerStorage:FindFirstChild( "NAME OF TOOL HERE" ) -- Make sure to put the tool in ServerStorage! |
05 |
06 |
07 | Balance = 100 -- Set here how much money you want for this item to cost! |
08 |
09 |
10 | money = player.leaderstats.CURRENCY |
11 |
12 |
13 |
14 | -- This script uses TextButton, or ImageButton1 |
15 | script.Parent.MouseButton 1 Click:connect( function () |
EXAMPLE: This is automatically giver.
01 | -- VARIABLES |
02 |
03 | player = script.Parent.Parent.Parent.Parent.Parent |
04 |
05 |
06 | local tool = game.ServerStorage:FindFirstChild( "NAME OF TOOL HERE" ) -- Make sure to put the tool in ServerStorage! |
07 |
08 |
09 | Balance = 100 -- Set here how much money you want for this item to cost! |
10 |
11 |
12 | money = player.leaderstats.CURRENCY |
13 |
14 |
15 | -- CODING |
That's it, btw sorry for my bad English! If this script worked for you, feel free to accept my answer!
Use something along these lines
1 | if Money.Value > = 20 then |
2 |
3 | --or |
4 |
5 | if Money.Value > = 50 then |
Here is an example:
1 | local item = game.ReplicatedStorage.item:clone |
2 | if Cash.Value > = 100 then |
3 | item.Parent = game.Players.LocalPlayer.Backpack |
4 | end |
Change things up a little if it didn't work. I'm just new to RBLX Lua.
01 | magic = game. -- put magic's path. |
02 | sword = game. -- put sword's path |
03 | money = game. -- put money's path |
04 | plr = game.Players.LocalPlayer |
05 |
06 | if money.Value > = 20 then |
07 | magic:Clone().Parent = plr.Backpack |
08 | end |
09 |
10 | if money.Value > = 50 then |
11 | sword:Clone().Parent = plr.Backpack |
12 | end |