Premium only Teleporters

Hello scripters!

Can someone make me a teleporters that only premium players can use?
im really bad at scripting

Thanks!
-underTVyt

2 Likes

Funnily enough, this is the example that was on the Developer Hub for the premium purchases.

All you have to do is edit the place id at the top of the script.

3 Likes

I do not want the player to be teleported into another game
i want to make the player to be teleported somewhere else on the map

This is not the place to ask for script, but for help. If you want someone to write code for you, use #collaboration:recruitment

Okay.
Where the teleport to server takes place, remove that and add this:
player.Character.HumanoidRootPart.CFrame = yourTargetPositionHere
Remember the yourTargetPositionHere must be a CFrame value
(e.g. yourTargetPositionHere = CFrame.new(0, 0, 0)

2 Likes

Sure ill try that for you but you do have to edit the script a bit

block.Touched:Connect(function(hit)
local humroot = hit.Parent:FindFirstChild("HumanoidRootPart")
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum and humroot then
if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).MembershipType == Enum.MembershipType.Premium then
humroot.Position = Vector3.new(xposition,yposition,zposition)
else
local mps = game:GetService("MarketplaceService")
mps:PomptPremiumPurchase(game:GetService("Players"):GetPlayerFromCharacter(hit.Parent))
  end
   end   
game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerMembershipChanged:Connect(function()
-- check if membership is changed
humroot.Position = Vector3.new(xposition,yposition,zposition)
  end)
end)

Curious, why are you checking for the humanoid and humanoid root part?

Just incase but im pretty sure it would work fine anyway

Okay sorry that one wasn’t working I just typed that out plain sorry.

I tested this one tho and it worked for me after I bought premium on the test purchase.

local block = workspace:WaitForChild(“SpawnLocation”)

block.Touched:Connect(function(hit)
	   local char = hit.Parent
		local hum = char:FindFirstChild("Humanoid")
		local hrp = char:WaitForChild("HumanoidRootPart")
			if hum
			 then
				local player = game:GetService("Players"):GetPlayerFromCharacter(char)
				if player.MembershipType == Enum.MembershipType.Premium
				then
					hrp.Position = Vector3.new(20,20,20)
		else
						local mps = game:GetService("MarketplaceService")
						mps:PromptPremiumPurchase(player)
						game:GetService("Players").PlayerMembershipChanged:Connect(function(plr)
						  if plr.Name == player.Name then
							plr:WaitForChild("HumanoidRootPart").Position = Vector3.new(20,20,20)
								end
						end)
				end
		end
end)

Edit it ovbiously to suit your game.

you can always can read about that here: (the script is on the sec link)