(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
hi im new to lua and im trying to make a teleporter between places?
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
not brick touch srry i know that i want button press and its locked to players that have vistited place 2
My bad. Misread. I'll do that in a minute.
ok thx
updated it. hopefully you meant physical button. if you meant a gui button, then that's another thing.
but how do i lock it for people who visited place 2
what do you mean?
i mean like its locked when you first join then once you get to place 2 it unlocks for further use
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.

2 comments
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
ive had 18 views and no one will help