Hi. I am making a roblox game like Myst 3 Exile. So I am making books which when you click an imagebutton it teleports you to another place. But my scripts for the teleporting arent working at all.
This is my teleporter script.
local TeleportService = game:GetService("TeleportService") local level1Id = 2573376319 --local level2Id = game.Players.PlayerAdded:connect(function(player) TeleportService:Teleport(level1Id, player) end)
This is the path for the image thing https://imgur.com/a/vNlwir2
So how do I fix it so when you click the image in the surface gui on the block it teleports you to the place. I cant find it anywhere.
You should put an ImageButton on your surfacegui and then use the MouseButton1Click event, if I'm not mistaken. Or, if you use ClickDetectors, it will be for the entire part it's in, not just an image, so put the image in a separate part with the ClickDetector, if you're using that. Your code sends a player in another place when they enter. Not useful?