Teleport script not working?

My script isnt working?

For some reason the script doesn’t work?
If U can help kindly do so

local Teleport = workspace.TeleportPad 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)

local Teleport = workspace.TeleportPad
function Touch(hit)
	if script.Parent.Locked == false and script.Parent.Parent:FindFirstChild("TeleportPad").Locked == false then -- Maybe 'Teleport.Locked == false' ??
		script.Parent.Locked = true -- was 'time' instead of 'true'
		script.Parent.Parent:FindFirstChild("TeleportPad").Locked = true
		local pos = script.Parent.Parent:FindFirstChild("TeleportPad") -- Variable never used
		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)
1 Like

Im gonna try that
If It works, I’ll be sure to solution it

local DestinationPart = workspace:WaitForChild("TeleportPad")
local Teleporter = script.Parent
local Cooldown = 1 -- Seconds
local Offset = Vector3.new(0,10,0)
local UseColors = true
local ReadyColor = Color3.fromRGB(0,255,0)
local CooldownColor = Color3.fromRGB(255,0,0)
-----------------------------------------------------------------
local dbg = true
Teleporter.Touched:Connect(function(t)
	local player = game.Players:GetPlayerFromCharacter(t.Parent)
	if player and dbg then
		if UseColors then
			script.Parent.Color = CooldownColor
		end
		
		dbg = false
		local character = t.Parent
		character:moveTo(DestinationPart.Position + Offset)
		wait(Cooldown)
		dbg = true
		if UseColors then
			script.Parent.Color = ReadyColor
		end
	end
end)

Im pretty sure this wasnt meant for me lol

It is.

Set DestinationPart to where you want to get teleported to, set Teleporter to the part you want to have to be touched in order to be teleported, set Cooldown to the time the teleporter will be inactive after usage.

1 Like

Its just teleports me to itself?

Teleporter.rbxl (29.3 KB)

1 Like