By script was supposed to give you a sniper and takes away $100 then once you have it and its you're backpack you can't get another one. But the only thing that works is when it takes away the money.
Script:
local Cash = game.Players.LocalPlayer.leaderstats.Cash -- change Cash to your currency
function onClicked()
if Cash.Value >= 100 then --change 350000 to the amount it costs
Cash.Value = Cash.Value - 100 --change 350000 to the amount it costs
end
end
script.Parent.MouseButton1Down:connect(onClicked)
local price = script.Parent.Parent.BuyNowSniper
local Player = script.Parent.Parent.Parent.Parent.Players.LocalPlayer
Tool = script.Parent
Tool.Equipped:connect(function()
if game.Players[Tool.Parent.Sniper].Backpack:FindFirstChild(Tool.Sniper) ~= nil then
price.Text = "You Already Have That Item"
end
end)
local p = game.Players.LocalPlayer
local Cash = game.Players.LocalPlayer.leaderstats.Cash
script.Parent.MouseButton1Click:connect(function()
local tool = script.Parent.Sniper:Clone()
tool.Parent = p.Backpack
end)
what do i need remove or add? Thanks, Peace :3
