How do I make this script that only teleports 1 player?


It teleports everyone in game, but I only want one to be teleported when clicked.

People: Dude you literally got it from toolbox, you need to make your own code you stupid… Go die irl

No first of all I copied it from tutorial that my friend gave me when I asked her how to get script teleport and I’m currently trying to understand.

I feel like the i and the Players has something to do with making everyone teleported, But idk what to replace it from

Simply put return. That will make it run only once.

We can see that MouseClick returns the player who clicked it.

local TELEPORT_POSITION =, 500, 0)

local clickDetector = script.Parent.ClickDetector

-- Called when a player clicks the click detector
local function onMouseClick(player)
    local character = player.Character

1 Like

Ahhh that makes sense, I really need to find a Roblox Lua code Book if there’s one irl but thank you so much!