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'
player = script.Parent.Parent.Parent.Parent.Parent local tool = game.ServerStorage:FindFirstChild("NAME OF TOOL HERE") -- Make sure to put the tool in ServerStorage! Balance = 100 -- Set here how much money you want for this item to cost! money = player.leaderstats.CURRENCY -- This script uses TextButton, or ImageButton1 script.Parent.MouseButton1Click:connect(function() if money.Value >= Balance then local item = tool:Clone() item.Parent = player.Backpack money.Value = money.Value - Balance -- Remove this line if you want that you don't lose your money when you purchase this item! Otherwise, leave this! end end)
EXAMPLE: This is automatically giver.
-- VARIABLES player = script.Parent.Parent.Parent.Parent.Parent local tool = game.ServerStorage:FindFirstChild("NAME OF TOOL HERE") -- Make sure to put the tool in ServerStorage! Balance = 100 -- Set here how much money you want for this item to cost! money = player.leaderstats.CURRENCY -- CODING if money.Value >= Balance then local item = tool:Clone() item.Parent = player.Backpack end
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
if Money.Value >= 20 then --or if Money.Value >= 50 then
Here is an example:
local item = game.ReplicatedStorage.item:clone if Cash.Value >= 100 then item.Parent = game.Players.LocalPlayer.Backpack end
Change things up a little if it didn't work. I'm just new to RBLX Lua.
magic = game. -- put magic's path. sword = game. -- put sword's path money = game. -- put money's path plr = game.Players.LocalPlayer if money.Value >= 20 then magic:Clone().Parent = plr.Backpack end if money.Value >= 50 then sword:Clone().Parent = plr.Backpack end