Hello!
I need some help with my sell point. I am trying to make it so the players can sell a leaderstat, for example Points, and get another stat, let’s say Coins.
So when the player sells 5 points, they get 5 cash. But, with this script, there’s multipliers so when you sell you will get 10 cash instead.
Well, I am also trying to make it so if you have a gamepass, it gives a better multiplier.
Here’s the script:
local SellPart = script.Parent
local ID = 82114987
SellPart.Touched:Connect(function(hit)
local H = hit.Parent:FindFirstChild("Humanoid")
if H then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local leaderstats = player:WaitForChild("leaderstats")
local Currency = leaderstats.BromineElement
local Selling = leaderstats.Cash
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, ID) then
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value * 4
Selling.Value = 0
end
else
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value * 2
Selling.Value = 0
end
end
end
end
end)
Nothing appears in the output, and it doesn’t give any cash.