I am making an obby and i have made my skip stage gui. It is working but each time i am testing it it teleports me to the next stage but half of my body is stuck to the floor. Sometimes i teleport properly but it is rare to happen.
This is my script:
local service = game:GetService("MarketplaceService")
local dev_product_id = 980377204
local stage_folder = workspace:WaitForChild("Stages")
wait(1)
if workspace:FindFirstChild("Stages") then
service.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == dev_product_id then
local plr = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
if plr then
local leaderboard = plr:FindFirstChild("leaderstats")
if leaderboard then
local stage = leaderboard:FindFirstChild("Stage")
if stage then
if stage_folder:FindFirstChild("Stage" .. stage.Value+1) then
wait()
plr.Character.HumanoidRootPart.CFrame = CFrame.new(stage_folder:FindFirstChild("Stage" .. stage.Value+1).Position)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
end
else
print("Not found Stages In the Stages folder.")
end
This script is located in ServerScriptService.

2 comments
your question is a little confusing. Do you teleport each time, but you're stuck in the floor, or are you only teleporting sometimes?
I teleport in the floor.