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

How do you make it if they have enough of cash they get an item added to their starter pack?

Asked by
Tizzel40 243 Moderation Voter
7 years ago

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 )

0
Use a conditional statement of the form "if Cash.Value == 20 then... ". Le_Teapots 913 — 7y
0
not constructive kek Fifkee 2017 — 7y

4 answers

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

Example: This is for 'SHOP'

01player = script.Parent.Parent.Parent.Parent.Parent
02 
03 
04local tool = game.ServerStorage:FindFirstChild("NAME OF TOOL HERE") -- Make sure to put the tool in ServerStorage!
05 
06 
07Balance = 100 -- Set here how much money you want for this item to cost!
08 
09 
10money = player.leaderstats.CURRENCY
11 
12 
13 
14-- This script uses TextButton, or ImageButton1
15script.Parent.MouseButton1Click:connect(function()
View all 25 lines...

EXAMPLE: This is automatically giver.

01-- VARIABLES
02 
03player = script.Parent.Parent.Parent.Parent.Parent
04 
05 
06local tool = game.ServerStorage:FindFirstChild("NAME OF TOOL HERE") -- Make sure to put the tool in ServerStorage!
07 
08 
09Balance = 100 -- Set here how much money you want for this item to cost!
10 
11 
12money = player.leaderstats.CURRENCY
13 
14 
15-- CODING
View all 22 lines...

That's it, btw sorry for my bad English! If this script worked for you, feel free to accept my answer!

Ad
Log in to vote
0
Answered by 7 years ago

Use something along these lines

1if Money.Value >= 20 then
2 
3 --or
4 
5if Money.Value >= 50 then
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Here is an example:

1local item = game.ReplicatedStorage.item:clone
2if Cash.Value >= 100 then
3    item.Parent = game.Players.LocalPlayer.Backpack
4end

Change things up a little if it didn't work. I'm just new to RBLX Lua.

0
lol your script is broken. Elixcore 1337 — 7y
Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
7 years ago
Edited 7 years ago
01magic = game. -- put magic's path.
02sword = game. -- put sword's path
03money = game. -- put money's path
04plr = game.Players.LocalPlayer
05 
06if money.Value >= 20 then
07magic:Clone().Parent = plr.Backpack
08end
09 
10if money.Value >= 50 then
11sword:Clone().Parent = plr.Backpack
12end
0
so what do you mean when you say path?do you mean replicated storage? Tizzel40 243 — 7y
0
for example let's say sword is located in ReplicatedStorage you do this game.ReplicatedStorage.sword Elixcore 1337 — 7y

Answer this question