So, when you step into a door, this gui is meant to show up. When you click the button, you then get teleported.
GUI Script
function onClick(mouse) local player = game.Players:GetPlayerFromCharacter(onClick.Parent) if player then game:GetService("TeleportService"):Teleport(327607038, player) end end script.Parent.MouseButton1Click:connect(onClick)
Door Script
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.StarterGui.Teleport.Visible = true end end script.Parent.Touched:connect(onTouched)
Gui Script
function onClick() game:GetService("TeleportService"):Teleport(327607038, game:GetService("Players").LocalPlayer) end script.Parent.MouseButton1Click:connect(onClick)
Door Script
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.PlayerGui.Teleport.Visible = true end end script.Parent.Touched:connect(onTouched)
Try that. That is assuming that the Gui script is a LocalScript.