- BrickPlanet Forum
- Game & Scripting Discussion
- Free teleportation
-- Made by Asulin local Players = game:GetService("Players")
-- Function to teleport a player to a specified location local function teleportPlayer(player, location) player.Character.HumanoidRootPart.CFrame = location end
-- Bind the function to a chat command game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) -- Check if the message is the teleport command if message:lower() == "!teleport" then -- Get the target player local targetPlayer = Players:GetPlayerFromCharacter(player.Character) -- Set the target player's location teleportPlayer(targetPlayer, CFrame.new(0, 100, 0)) end end) end)
To use this script in your Roblox game, follow these steps:
1.Create a new script in the game's workspace. 2.Copy and paste the code into the new script. 3.Save the script. 4.Bind the script to a chat command by adding a "Chat" service and connecting the Chatted event. 5.Test the script by typing the command "!teleport" in the chat while in-game to teleport the player to the specified location.
Apologies that above one is for roblox, this one is for brickplanet:
local Players = game:GetService("Players")
-- Function to teleport a player to a specified location local function teleportPlayer(player, location) player.Character.HumanoidRootPart.CFrame = location end
-- Bind the function to a chat command game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) -- Check if the message is the teleport command if message:lower() == "!teleport" then -- Get the target player local targetPlayer = Players:GetPlayerFromCharacter(player.Character) -- Set the target player's location teleportPlayer(targetPlayer, CFrame.new(0, 100, 0)) end end) end)
To use this script in the BrickPlanet workshop, follow these steps:
Create a new script in the workshop. Copy and paste the code into the new script. Save the script and publish it to your library. Add the script to the game as a server script. Start the game and type the command "!teleport" in the chat to teleport the player to the specified location.
Apologies that above one is for roblox, this one is for brickplanet:
local Players = game:GetService("Players")
-- Function to teleport a player to a specified location local function teleportPlayer(player, location) player.Character.HumanoidRootPart.CFrame = location end
-- Bind the function to a chat command game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) -- Check if the message is the teleport command if message:lower() == "!teleport" then -- Get the target player local targetPlayer = Players:GetPlayerFromCharacter(player.Character) -- Set the target player's location teleportPlayer(targetPlayer, CFrame.new(0, 100, 0)) end end) end)
To use this script in the BrickPlanet workshop, follow these steps:
Create a new script in the workshop. Copy and paste the code into the new script. Save the script and publish it to your library. Add the script to the game as a server script. Start the game and type the command "!teleport" in the chat to teleport the player to the specified location.
Very useful, thanks for sharing.