Hello everyone! I was wondering how I would go about scripting a free skip stage when someone joins my group. I already have a partial script set up that fetches data to see if the person is in the group or not but I am not sure how to script it so that they get the free stage skip. I will include my skip stage script and my partial joining group script. I am not entirely sure how to go about this since I’m still learning scripting but any help is appreciated!
Joining Group Partial Script:
local groupid = 16957880
local devProductID = 1388352883
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRoleInGroup(groupid) ~= "Guest" then
end
end)
Skip Stage Script:
local mps = game:GetService("MarketplaceService")
local devProductID = 1388352883
mps.ProcessReceipt = function(purchaseInfo)
local plrPurchased = game.Players:GetPlayerByUserId(purchaseInfo.PlayerId)
if not plrPurchased then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if purchaseInfo.ProductId == devProductID then
if tonumber(plrPurchased.leaderstats.Stage.Value) < #workspace.Checkpoints:GetChildren() - 1 then
plrPurchased.leaderstats.Stage.Value = plrPurchased.leaderstats.Stage.Value + 1
else
plrPurchased.leaderstats.Stage.Value = "End"
end
plrPurchased:LoadCharacter()
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end