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

hi im new to lua and im trying to make a teleporter between places?

(warning im not good at spelling)the teleporter that im trying to make is a button teleporter that req to get to the other place first without bange

2 comments

0

or a better way to say is you unlock the place and you will teleport there with button press and once you get to place 2 you will unlock it without bage

0

ive had 18 views and no one will help

1 answer

You can teleport a player when they click an button like so: The script is saying: when a player clicks a button, get their player object from their character and teleport the player to the specified place. Make sure you have a click detector object inside of the button part and this script inside of the button:

local TeleportService = game:GetService("TeleportService")
 
placeID = 408502340
clickDetector = script.Parent.ClickDetector --location of the click detector
 
--when the button is clicked, teleport player
clickDetector.MouseClick:Connect(function(playerWhoClicked)
	local player = playerWhoClicked

	if player then
		TeleportService:Teleport(placeID, player)
	end
end

8 comments

0

not brick touch srry i know that i want button press and its locked to players that have vistited place 2

0

My bad. Misread. I'll do that in a minute.

0

ok thx

0

updated it. hopefully you meant physical button. if you meant a gui button, then that's another thing.

0

but how do i lock it for people who visited place 2

0

what do you mean?

0

i mean like its locked when you first join then once you get to place 2 it unlocks for further use

0

is place 2 in game? if yes then have a variable that changes when lace two has bbeen visited. if it's in another place, you'd need to use datastore to keep track. btw mark my answer as the answer if you can please and if you need anything else please ask

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