Hi! Can anyone explain me how can I make a skip stage button with a developer product? I don´t know how to script it into my game (Lynaticos Obby), and I have already tried to search for a solution in the forum but I can`t get an answer.
What is the problem? For skip stage button itself is easiest way to do it by moving player character to next spawn, for dev product, l look on developer hub, there is quite good article about it.
This all depends on how the stage is stored in your game, whether it’s stored in the leaderboard or stored as an independent value somewhere else, you should refer to the developer hub for the use of developer products and explain how stages are stored in your game so we can assist you further.
Let’s say you store your stages in a Number Value, you would just refer to the developer hub to set up your developer product purchase processing and increase the stage value by 1. Afterwards, you can set the position of the character to the next stage.
E.g.,
NumberValue.Value = NumberValue.Value + 1
game.Players['PlayerName'].Character:MoveTo(Vector3.new(StagePosition))
Please, try your best to do all of the purchase processing on your own and if you still can’t figure it out, please reply and I’ll do my best to assist you further.
Here’s a link to the developer hub, this is where you’ll find all of the information regarding developer products. https://developer.roblox.com/en-us/articles/Developer-Products-In-Game-Purchases
First, make leaderstats(server script inside serverscriptstorage):
game.Players.PlayerAdded:Connect(function(player)
local Stats = Instance.new("Folder",player)
Stats.Name = "leaderstats"
local Level = Instance.new("IntValue", Stats)
Level.Name = "Level"
end)
then use a table(put this script inside starterGui as a local script):
local stagePositions = {(1,1,1), (2,2,2), (3,3,3)} -- inside the brackets are the positions of the stages
local Level = game.Player.LocalPlayer.Level
Level.Changed:Connect(function()
game.Players.LocalPlayer.Character:MoveTo(Vector3.new(stagePositions[Level.Value])
end)
You pretty much answered your own question, minus the fact that you obviously haven’t properly searched for how to do this. A five second search revealed a support topic about stage skipping with given code and fixes to the problem.
Its not just the DevForum that you should search before giving up and resolving to post a thread. Check the toolbox, check online, there are definitely resources you can use to help you accomplish your goals.
You want to create a script that skips a stage if you buy a product. Great. Figure out your needs first.
-
Do users need to buy the product? Obviously. PromptProductPurchase.
-
Do you need to do something when players buy the product? Yes. ProcessReceipt.
-
What do you need to happen when the player buys a product? Skip a stage. Increment their stage value and teleport them to the next stage.
There you go. Go try stuff out. This category isn’t a place for you to receive code. If you don’t know how to, try it first at the very least. Category guidelines, for reference.