I had to modify a few things in the script, I’m testing to see if it works!
I’m literally dealing with like 50 issues at once aaa-
Yeah you can use the PromptGamepassPurchase
function I believe, then detect when the player has successfully purchased the gamepass using the PromptGamepassPurchaseFinished
event:
script.Parent.Touched:Connect(function(part)
local Char = part.Parent
local player = game.Players:GetPlayerFromCharacter(Char)
if player then
if EASports:UserOwnsGamePassAsync(player.UserId, GamepassIDHere) then
event:FireClient(player, script.Parent.Destination.Value)
Char.HumanoidRootPart.Position = PartPosition
else
EASports:PromptGamePassPurchase(player.UserId, GamepassIDHere)
EASports.PromptGamePassPurchasedFinished:Connect(function(Player, GamepassIDHere, PurchaseCheck)
if PurchaseCheck == true then
event:FireClient(player, script.Parent.Destination.Value)
Char.HumanoidRootPart.Position = PartPosition
end
end)
end
end
end)
Oh no, hopefully I’m not pushing you!
did you script work? If not can i see it
Would this be an addition to the end of the script? Like this:
local event = game.ReplicatedStorage:FindFirstChild(“DoFancyTeleport”)
local EASports = game:GetService(“MarketplaceService”)
local GamepassIDHere = 16996503
if not event then
event = Instance.new(“RemoteEvent”)
event.Name = “DoFancyTeleport”
event.Parent = game.ReplicatedStorage
end
local gui = game.StarterGui:FindFirstChild(“TeleporterFlash”)
if not gui then
print("The TeleporterFlash GUI was automatically moved to the StarterGui.")
print("If you plan to edit it, we recommend moving it yourself first.")
gui = script.Parent.Parent.TeleporterFlash:Clone()
gui.Parent = game.StarterGui
end
script.Parent.Touched:Connect(function(part)
local Char = part.Parent
local player = game.Players:GetPlayerFromCharacter(Char)
if player then
if EASports:UserOwnsGamePassAsync(player.UserId, GamepassIDHere) then
event:FireClient(player, script.Parent.Destination.Value)
else
EASports:PromptGamePassPurchase(player.UserId, GamepassIDHere)
EASports.PromptGamePassPurchasedFinished:Connect(function(Player, GamepassIDHere, PurchaseCheck)
if PurchaseCheck == true then
event:FireClient(player, script.Parent.Destination.Value)
end
end)
end
end
end)
It works, kinda. It teleports players with the gamepass only, but it doesn’t prompt players without the gamepass.
so with PartPosition what is your varible?
I removed them because the script would work with them or not, so to make it cleaner I removed them. What is going wrong is the prompt purchase.
That worked! Thanks so much to you, and @JackscarIitt for helping! I’m not going to mark any of you solution, because you both put lots of work into it! Thanks again! -ItsKoolPlayz
You Are Always Welcome! If You Have Any More Issues, Don’t Be Afraid To Make Another Comment!
(Make Me Solution, JK) lol
Ok after catching up I’m finally back to here
I do recommend though that you please choose 1 solution, so that people are aware about the issue being solved