Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

(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

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 xeromusASF3 0 — 5y
0
ive had 18 views and no one will help xeromusASF3 0 — 5y

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

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

0
not brick touch srry i know that i want button press and its locked to players that have vistited place 2 xeromusASF3 0 — 5y
0
My bad. Misread. I'll do that in a minute. royaltoe 5144 — 5y
0
ok thx xeromusASF3 0 — 5y
0
updated it. hopefully you meant physical button. if you meant a gui button, then that's another thing. royaltoe 5144 — 5y
View all comments (4 more)
0
but how do i lock it for people who visited place 2 xeromusASF3 0 — 5y
0
what do you mean? royaltoe 5144 — 5y
0
i mean like its locked when you first join then once you get to place 2 it unlocks for further use xeromusASF3 0 — 5y
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 royaltoe 5144 — 5y
Ad

Answer this question