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 :(
COMMUNITY QUESTION
How do I make it so a player has to have this item to buy this item?
1 answer
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 ^^
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Like money or cash? or a tool..
state that if the player has the tool in backpack, item can be bought