local module = require(game.Workspace:FindFirstChild("Techy's Obby System").Configurations)
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if game.Workspace[player.Name].leaderstats.Stage.Value < game.Workspace.SkipStageLimit.Value then
game:GetService("MarketplaceService"):PromptProductPurchase(player, module.skipStageProductID)
end
end)
COMMUNITY QUESTION
Adding a limit so you can't skip stage at the end of the obby?
1 answer
Fixed it on my own, no worries.
local module = require(game.Workspace:FindFirstChild("Techy's Obby System").Configurations)
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if tonumber(player.leaderstats.Stage.Value) < game.Workspace.SkipStageLimit.Value then
game:GetService("MarketplaceService"):PromptProductPurchase(player, module.skipStageProductID)
end
end)
the reason it didn't work is because the leaderstats is a string value and I needed to convert it into an integer.
2 comments
0
If anyone else is having this problem, use tonumber.
0
you can also add some code so if they dont purchase it they get respawned.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I believe the main problem is line 5.