I've been trying to make this Teleporter for my Lobby that teleports into the actual game but it doesn't seem to work
It has to work like this "The player walks on the platform" "It has a countdown on like 20" "after those 20 seconds are gone the player should teleport but if the player walks off the platform it shouldn't teleport Anybody got an idea for what I'm missing? Thanks I'm still pretty new to scripting
debounce = false
local TeleportService = game:GetService("TeleportService")
local gameID = 4975499287
function onTouched(hit)
if debounce == false then
debounce = true
print("Teleporter1 Touched")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
wait(20)
TeleportService:Teleport(gameID, player)
end
end
script.Parent.Touched:connect(onTouched)
script.Parent.TouchEnded:Connect(function()
if debounce == true then
debounce = false
end
end)

1 comment
Possibly use a debounce, I am new so I do not know much.