in-game leaderstats:
first you need to insert a numbervalue in the button, after get the player from the character. then check in the leaderstats if the player have equals or greater then the cost. to find that out, you will need to compare the costs. so,
script.Parent.Touched:Connect(function(h)
local plr = game:GetService("Players"):GetPlayerFromCharacter(h.Parent)
local currency = plr.leaderstats.PUTCURRENCYNAMEHERE
local cost = script.Parent.Cost
if currency.Value >= cost.Value then
end
end)
but, we didn't remove the cash. so that means they can get as many morphs they want so our final product will be:
script.Parent.Touched:Connect(function(h)
local plr = game:GetService("Players"):GetPlayerFromCharacter(h.Parent)
local currency = plr.leaderstats.PUTCURRENCYNAMEHERE
local cost = script.Parent.Cost
if currency.Value >= cost.Value then
currency.Value = currency.Value-cost.Value
end
end)
actual robux:
first you need a touched event, a gamepass, and to get the player from the character. then after that, you need a purchase prompt for the gamepass and to get the marketplaceservice. so what would you do is
script.Parent.Touched:Connect(function(h)
local plr = game:GetService("Players"):GetPlayerFromCharacter(h.Parent)
marketservice = game:GetService("MarketplaceService")
if marketservice:UserOwnsGamePassAsync(plr.UserId, gamepassidhere) then
else
marketservice:PromptGamePassPurchase(plr.UserId,gamepassid)
end
1 comment
You should research more about other stuff and learn the basics and then get into the harder stuff like thie for example.