Hello I would need help on a skip stage script as I tried every tutorials I could found and others stuff but nothing was working, so if someone could help me make one with the stage script below working (By purchasing a dev product it tp to next stage) it would be really cool and if its working im willing to give some robux to the person that helped me thanks
local Stages = workspace:WaitForChild("Stages")
for i,Stage in pairs(Stages:GetChildren()) do
Stage.Touched:Connect(function(touch)
local humanoid
if touch.Parent:FindFirstChild("Humanoid") then
humanoid = touch.Parent.Humanoid
end
if touch.Parent and touch.Parent.Parent:FindFirstChild("Humanoid") then
humanoid = touch.Parent.Parent.Humanoid
end
if humanoid then
local player = game.Players:GetPlayerFromCharacter(humanoid.Parent)
local PlayerStage = player.leaderstats.Stage.Value
if tonumber(Stage.Name) == PlayerStage + 1 then
player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
elseif tonumber(Stage.Name) > PlayerStage + 1 then
humanoid.Health = 0
end
end
end)
end
If they buy the product, just add the stage value to 1 and tp them to the stage:
-- The code that tp the player to the next stage
player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
player.Character.HumanoidRootPart.CFrame = "stage block name".CFrame -- Note: You may get stuck in the block.
-- Local script for the button that purchase dev product
MPS = game:GetService("MarketplaceService")
id = 000000000 -- replace with your ID
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
MPS:PromptProductPurchase(player, id)
end)
-- Script that handle the purchase
local MPS = game:GetService("MarketplaceService")
MPS.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 000000000 then -- replace with your ID here
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
player.Character.HumanoidRootPart.CFrame = "stage block name".CFrame
end
end
For more information, read the wiki about the dev product.
I’m not the best with this thing, I just use a free model for this kind of thing, I take the script I need, copy it and past it into my gui! Normally I just take the model.
Okay just one moment as I will pull up the game link and open up the studio. I am playing a game and replying and helping people all at once that is why I might take a bit to reply.
I can’t find the name of the model, I will copy the model and make it a model on the website and let you take it then after you take it put it off sale. So please let me know when you take it. https://web.roblox.com/library/5107037632/Test
If it is for an obby, then it should work because it worked for me. For some reason, I just really like editing posts of mine. I know that might be spamming so I won’t do it as much.
Test it and purchase it. NOTICE: Make sure to make your own developer product or else when people purchase it the robux would go to me. And put the id of your developer product in it. If it doesn’t work and when you buy it and it gives you the stage plus, try resetting your character because it does it for me when I reset my character.