Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make players teleport to another place when they click on something?

In my left 4 dead, for the finale I have players surviving on a rooftop and they need to survive for 2 minutes before the helicopter arrives, when the helicopter arrives I want them to be teleported when they click the helicopter but its not working, can someone help?

What else would I have to put on here to make it work?

function(Onclick) if game.Workspace.Helicopter.ClickDetector.MouseClick=true game:GetService('TeleportService')

end

3 comments

0

You want to look at the function which teleports the group of players to the same server.

0

Do you want them to teleport do a different game server or another place inside the game? (Like teleport them from one position to another)

0

another place inside the game

1 answer

local TeleportService = game:GetService("TeleportService")
local PlaceID = 1818
local function MouseClick(Player)
	if Player then -- Not needed, just like it to be clean.
		TeleportService:Teleport(PlaceID, Player)
	end
end
script.Parent.ClickDetector.MouseClick:Connect(MouseClick)

Here's the script.

It's parented to a part with a ClickDetector in it.

3 comments

0

i tried it but its not wanting to work :/

0

Are you trying to do it in Studio? Give me your current script.

0

function Onclick() if game.Workspace.Helicopter.ClickDetector.MouseClick=true local TeleportService = game:GetService("TeleportService") local PlaceID = 1818 local function MouseClick(Player) if Player then -- Not needed, just like it to be clean. TeleportService:Teleport(PlaceID, Player) end end script.Parent.ClickDetector.MouseClick:Connect(MouseClick)

This discussion is preserved as it was. New answers, comments, and votes are closed.