Change walkspeed, wait, then tp to a different game

Trying to make a part that when a player touches it, it will: change their walkspeed to 0, wait 10 seconds, then teleport them to a different game. Started scripting recently so I’m not sure where to begin.

3 Likes

You can use the .Touched event inside a server script which is a child of the Part.

local placeid = 0 // the place id
local teleportservice = game:GetService("TeleportService")

script.Parent.Touched:Connect(function(hit)
  local player = game.Players:FindFirstChild(hit.Parent.Name)

  if player then
    player.Character.Humanoid.WalkSpeed = 0
    task.wait(10)
    teleportservice:Teleport(placeid, player)
  end
end)

Also make sure 3rd party teleports are enabled in game settings!

2 Likes

U need to handle failed teleports too
U can find a free module here:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.