Hello, so I was wondering how to make a VIP teleporter only. Basically I have a VIP gamepass, and I want people to be able to teleport if they have the gamepass, and if they don’t then it will prompt them to purchase it. Can anyone help me with the script? Thanks in advance! -ItsKoolPlayz
Teleporter Script:
local event = game.ReplicatedStorage:FindFirstChild(“DoFancyTeleport”)
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
–[[
When touched, fire the DoFancyTeleport event and send it the brick we want them to teleport to, telling the client to begin the teleport.
–]]
script.Parent.Touched:Connect(function(part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
event:FireClient(player, script.Parent.Destination.Value)
end
end)
2 Likes
RIP THE CODE, it’s not formatted correctly
Are you wanting to teleport players to a place that have VIP players only, is what I’m assuming if they have the gamepass?
1 Like
IKR! It’s formatted correctly In-Studio, but I can’t seem to get it formatted on the dev forum…LOL! And yes, exactly what I want!
Well, you could either do this a variety of ways but I’ll choose the simple one
You can create a new place, check if the player has the gamepass using MarketplaceService’s UserOwnsGamePassAsync
function, & if they do, use TeleportService’s Teleport
function to teleport the player to that VIP only place
It should look something like this?
local event = game.ReplicatedStorage:FindFirstChild("DoFancyTeleport")
local EASports = game:GetService("MarketplaceService")
local TPService = game:GetService("TeleportService")
local VIPIDHere = 0000
local GamepassIDHere = 0000
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 player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
if EASports:UserOwnsGamePassAsync(player.UserId, GamepassIDHere) then
TPService:Teleport(VIPIDHere, player)
event:FireClient(player, script.Parent.Destination.Value)
end
end
end)
1 Like
May I ask, what does the VIPid do?
well the do a
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassFasterSpeed) then
--do stuff
end
edit: btw @JackscarIitt i did not see your post and i did not copy it
The VIP Id is just simply the Place ID you want to teleport the player to
Example:
https://www.roblox.com/games/094230923
Where the Int64 value, is the Place ID
Oh, the teleporter teleports players off the island to a VIP “Party Area”. Sorry for the confusion.
1 Like
That’s literally what I mentioned in my post
If you’re wanting to teleport the players to another place inside the same game, you can do that if the Player has the gamepass
If the “Party Area” is in the same place, you could just use TeleportToPrivateServer
instead
1 Like
I’m confused. How would I use TeleportToPrivateServer? Generally what this teleporter does is when the player hits a part, it teleports the player to another part. How would I use TeleportToPrivateServer or a VIPid in it? The gamepass Id and all that is what I wanted, but I also the system to check if the player has it, and if they don’t, it prompts them to purchase it. So where would TeleportToPrivateServer go into?
1 Like
is this a local script or serverscript
1 Like
Just the normal script. Not the LocalScript or module. Its a model the Royal High team made, if you want me to send you the link to it so you could try to make the modifications work, I can.
1 Like
ok. do you click a button to teleport?
Nope, its just you touch a part, then the script, fires a RemoteEvent, which adds a teleport flash for like 3 seconds, then you are arrived at another part.
1 Like
try this script
local event = game.ReplicatedStorage:FindFirstChild("DoFancyTeleport")
local EASports = game:GetService("MarketplaceService")
local TPService = game:GetService("TeleportService")
local VIPID = 0000
local GamepassID = 0000
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 player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
if EASports:UserOwnsGamePassAsync(player.UserId, GamepassID) then
TPService:Teleport(VIPID, player)
event:FireClient(player, script.Parent.Destination.Value)
else
EASports:PromptGamePassPurchase(player, GamepassID)
end
end
end)
Oh
You could’ve just mentioned that from the start I didn’t know if you wanted to use TeleportService service or not
local event = game.ReplicatedStorage:FindFirstChild("DoFancyTeleport")
local EASports = game:GetService("MarketplaceService")
local GamepassIDHere = 0000
local TargetPosition = workspace.Part --Change this to the target part where you want to teleport to
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)
wait(2)
Char.HumanoidRootPart.Position = PartPosition
end
end
end)
@JackscarIitt you need to in the script prompt the purchase if they do not own
The TargetPosition is a part called DestinationPart. And at the end, is there a way I can add a prompt purchase if the player doesn’t have the gamepass?
Also, the wait in it will not be necessary, idk how but the system determines the TeleportFlash time by itself.
do this script @ItsKoolPlayz (Same one just promts purchase)
local event = game.ReplicatedStorage:FindFirstChild("DoFancyTeleport")
local EASports = game:GetService("MarketplaceService")
local GamepassIDHere = 0000
local TargetPosition = workspace.Part --Change this to the target part where you want to teleport to
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)
wait(2)
Char.HumanoidRootPart.Position = PartPosition
else
EASports:PromptGamePassPurchase(player, GamepassID)
end
end
end)