Tutorial Level: Easy
Hi Today you will learn how to Script a Premium teleport pad.
Create the script and make it a child of the teleport pad.
First, we need to define Market Place Service
local MarketplaceService = game:GetService("MarketplaceService")
Second, thing we will need to do is define when someone touches the teleport pad.
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.Touched:Connect (function(hit)-- When they Touch the Pad this function will fire
end) -- This will end the Function
Next, we need to find the Player when they touch the part we will do this by finding the Player from the Character
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.Touched:Connect (function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)-- Find Player from Character
end)
Now We want to make it so if they have Premium they will get teleported and if they Don’t they will be prompted to buy it.
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.Touched:Connect (function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then -- this checks if what it hit was a player or a part
if player.MembershipType == Enum.MembershipType.Premium then -- this sees if they have premium
player.Character.HumanoidRootPart.Position = Vector3.new (0,0,0) -- this teleports them to the premium place. Make Sure to put your coordinates not these ones.
else -- if they don't have premium this will happen
MarketplaceService:PromptPremiumPurchase(player) -- This Prompts the Player to Buy Premium
end -- this ends the if statement
end
end)
Well There we Go You’ve done it and as a reward the longer Premium players spend in your game Roblox pays you Robux its their new Premium Payouts Feature.
Error Has Been Fixed
MAKE SURE if you are changing things to add different features Don’t Make it Pay To WIN
Make Sure to Like and tell me if you found a mistake or Error I will be sure to fix it.
Please Like this and if this get enough likes I might make videos on tutorials.
Example place Is located here Premium Teleport Pad Place - Roblox
Update: I Now Have A Youtube Channel I may make a tutorial of this going more in deep click here to subscribe