-
im tryna make a working skip stage that teleports to the next stage from which one the player is on
-
its teleporting to completely different parts that i did not list at all in the script, i have a folder in workspace with all the parts to keep it organized and lets say i have part 1, part 2 and part 3 in the folder, i set it in the script to teleport to part 1 on buy, i buy it and it teleports to part 3, i rejoin and it teleports to part 2, i rejoin and it teleports to random ones i didnt set
-
ive tried modifying it from teleporting to coordinates to teleporting to parts but then it just teleports to parts not listed in the script
there are multiple scripts so i will just provide 3, also it happens with every single one and it changes which random one to teleport my character to every time i rejoin
-- Replace this with your Dev Product ID
local devProductId = 1682137093
-- Reference to the Players service
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local Workspace = game:GetService("Workspace")
-- Define the destination part
local destinationPart = Workspace.SkipStageLocations:WaitForChild("Normal")
-- Function to handle the purchase of the Dev Product
local function onProductPurchase(receipt, player)
if receipt.ProductId == devProductId then
local character = player.Character
if character and destinationPart then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = destinationPart.CFrame
end
end
end
end
-- Function to prompt the purchase
local function promptPurchase(player)
MarketplaceService:PromptProductPurchase(player, devProductId)
end
-- Connect the onProductPurchase function to the ProcessReceipt callback
MarketplaceService.ProcessReceipt = function(receipt)
local player = Players:GetPlayerByUserId(receipt.PlayerId)
if player then
onProductPurchase(receipt, player)
end
end
-- Example usage: When a player steps on a part, prompt the purchase
local part = script.Parent
part.Touched:Connect(function(other)
local player = Players:GetPlayerFromCharacter(other.Parent)
if player then
promptPurchase(player)
end
end)
-- Replace this with your Dev Product ID
local devProductId = 1682137093
-- Reference to the Players service
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local Workspace = game:GetService("Workspace")
-- Define the destination part
local destinationPart = Workspace.SkipStageLocations:WaitForChild("Hard")
-- Function to handle the purchase of the Dev Product
local function onProductPurchase(receipt, player)
if receipt.ProductId == devProductId then
local character = player.Character
if character and destinationPart then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = destinationPart.CFrame
end
end
end
end
-- Function to prompt the purchase
local function promptPurchase(player)
MarketplaceService:PromptProductPurchase(player, devProductId)
end
-- Connect the onProductPurchase function to the ProcessReceipt callback
MarketplaceService.ProcessReceipt = function(receipt)
local player = Players:GetPlayerByUserId(receipt.PlayerId)
if player then
onProductPurchase(receipt, player)
end
end
-- Example usage: When a player steps on a part, prompt the purchase
local part = script.Parent
part.Touched:Connect(function(other)
local player = Players:GetPlayerFromCharacter(other.Parent)
if player then
promptPurchase(player)
end
end)
-- Replace this with your Dev Product ID
local devProductId = 1682137093
-- Reference to the Players service
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local Workspace = game:GetService("Workspace")
-- Define the destination part
local destinationPart = Workspace.SkipStageLocations:WaitForChild("Extreme")
-- Function to handle the purchase of the Dev Product
local function onProductPurchase(receipt, player)
if receipt.ProductId == devProductId then
local character = player.Character
if character and destinationPart then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = destinationPart.CFrame
end
end
end
end
-- Function to prompt the purchase
local function promptPurchase(player)
MarketplaceService:PromptProductPurchase(player, devProductId)
end
-- Connect the onProductPurchase function to the ProcessReceipt callback
MarketplaceService.ProcessReceipt = function(receipt)
local player = Players:GetPlayerByUserId(receipt.PlayerId)
if player then
onProductPurchase(receipt, player)
end
end
-- Example usage: When a player steps on a part, prompt the purchase
local part = script.Parent
part.Touched:Connect(function(other)
local player = Players:GetPlayerFromCharacter(other.Parent)
if player then
promptPurchase(player)
end
end)
here is a video i recorded of the issue happening including confirming that the part does in fact not specify that it should teleport to the “Impossible” part, it should be teleported to the “Normal” part and then the second one should be teleported to the “Hard” part but they both teleport to the impossible part… im extremely confused right now