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

?How to teleport to nearest seat after stepping on something?

Asked by 5 years ago

The code I have currently for it is supposed to make you go onto a seat after you step on something, it's not working out.

Script for Teleporter:

local Teleport = workspace.TeleportPoint function Touch(hit) if script.Parent.Locked == false and script.Parent.Parent:FindFirstChild("TeleportPad").Locked == false then script.Parent.Locked = time script.Parent.Parent:FindFirstChild("TeleportPad").Locked = true local pos = script.Parent.Parent:FindFirstChild("TeleportPad") hit.Parent:moveTo(workspace.TeleportPoint.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:FindFirstChild("TeleportPad").Locked = false end end script.Parent.Touched:Connect(Touch) ``

Script for game transfer: (The Game isn't made, so I have no ID yet.)

local TeleportService = game GetService ("TeleportService") local gameID = GAMEID

function onTouched (hit) local player = game.Players:GetPlayerFromCharachter (hit.Parent) if player then TeleportService:Teleport (gameID, player) end end

0
use code blocks raid6n 2196 — 4y

Answer this question