I have this script that when touching a part; you'll be teleported to a different game. This all works fine and dandy although I want to inverse it instead of touching a part after they defeat a boss, they'll be brought back to the main world. I cannot seem to figure out how to make it so they'll be teleported without having to touch a specific part. (I already have the boss defeating part scripted and that's all fine I just need the part where they teleport back for just being there)
wait(20)
local teleportservice = game:GetService("TeleportService")
local gameid = 6873694107
local function onparttouch(otherPart)
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
teleportservice:Teleport(gameid, player)
end
end
end

1 comment
Can you be a bit more specific regarding, "I already have the boss defeating part scripted"?