filmov
tv
Roblox How to | Button that Teleports You to Other Games (2022)
Показать описание
In this Roblox Studio Tutorial, I teach you guys step by step how to make a button that teleports you to other games when you click it!
Music used at the bottom of the description!
Script (To copy) I suggest watching the full video to understand how it works!
local teleport = game.ReplicatedStorage:WaitForChild("Teleportplayer") --Assigns a variable to the Remote Event in the Replicated Storage
script.Parent.MouseButton1Click:Connect(function() --Runs code when the button is clicked
teleport:FireServer() --Fire the Remote Event to the server
end) --End function
Script (Under the ServerScriptService)
local teleport = game.ReplicatedStorage:WaitForChild("Teleportplayer") ----Assigns a variable to the Remote Event in the Replicated Storage
local teleportservice = game:GetService("TeleportService") --Gets the teleport service in Roblox
local placeId = 6651677874 --Game Id, replace 6651677874 with your game Id
local players = game:GetService("Players") --Gets the players in the game
local player = players:GetPlayers()[1] --Gets the first player
teleport.OnServerEvent:Connect(function(player) --Code runs when the Remote Event is fired
teleportservice:TeleportAsync(placeId,{player}) --Teleports player to other game
end) --End function
Make sure to like and subscribe if you enjoyed it or if this video helped :)
Music Used:
Elektronomia - Sky High [NCS Release]
Tobu - Candyland
Tags: #roblox #robloxstudio #onfirerobloxscripting #tutorial
Music used at the bottom of the description!
Script (To copy) I suggest watching the full video to understand how it works!
local teleport = game.ReplicatedStorage:WaitForChild("Teleportplayer") --Assigns a variable to the Remote Event in the Replicated Storage
script.Parent.MouseButton1Click:Connect(function() --Runs code when the button is clicked
teleport:FireServer() --Fire the Remote Event to the server
end) --End function
Script (Under the ServerScriptService)
local teleport = game.ReplicatedStorage:WaitForChild("Teleportplayer") ----Assigns a variable to the Remote Event in the Replicated Storage
local teleportservice = game:GetService("TeleportService") --Gets the teleport service in Roblox
local placeId = 6651677874 --Game Id, replace 6651677874 with your game Id
local players = game:GetService("Players") --Gets the players in the game
local player = players:GetPlayers()[1] --Gets the first player
teleport.OnServerEvent:Connect(function(player) --Code runs when the Remote Event is fired
teleportservice:TeleportAsync(placeId,{player}) --Teleports player to other game
end) --End function
Make sure to like and subscribe if you enjoyed it or if this video helped :)
Music Used:
Elektronomia - Sky High [NCS Release]
Tobu - Candyland
Tags: #roblox #robloxstudio #onfirerobloxscripting #tutorial
Комментарии