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

How do I make it so a player has to have this item to buy this item?

Asked by 6 years ago

I mean like if I was to make a gun shop and you need this item to buy from the shop what would I need to do? I not good at scripting :(

0
Like money or cash? or a tool.. QuikzAgar 0 — 6y
0
state that if the player has the tool in backpack, item can be bought sweetlittlegirlohhl -22 — 6y

1 answer

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

A Good way of making this is to have a leaderstats not shown and call it for example: levelup add a stat called buy1 when the player will buy the gun, buy1 will receive 1 point. Why are you asking? Well, now you need a script that checks the stat, and if the stat is 1 then a command runs.

Here is the script of the stat checking.

local stat = game.Players.LocalPlayer.levelup.buy1 --leaderstat finding

stat.Changed:connect(function (property)
if stat.Value >= 1 then
--command
end
end)

remember this has to be a local script

Enjoy ^^

Ad

Answer this question