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

Teleporting to a different game based on a time sequence?

Asked by 4 years ago

I'm trying to create a game, and in the game I want to create a script in where after a set amount of time, it teleports you to a different game.

Here's the current code, I don't know how to create an event after a certain amount of time. That's all I need help with.

wait(5)

local TeleportService = game:GetService("TeleportService")
local Place = 4690177594


1 answer

Log in to vote
0
Answered by
s_iara 94
4 years ago
Edited 4 years ago

I'm not sure about how to go about this. I know how to make someone teleport if they're touching something so my suggestion is that you maybe make a part on the ground or something, or somehow make it so players are automatically touching it. Make sure it's transparent and cancollide to checked on, so it would look better of course. That's what I would do, and I'd go about this by putting this script under the part.

wait(5)
local TeleportService = game:GetService("TeleportService") --teleporting system
local gameID = 4690177594  --your game id ofc

function onTouched(hit) --if the players touching the brick then
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(gameID, player) --teleporting
    end
end

script.Parent.Touched:connect(onTouched)

If this isn't what you wanted (which I know it was not), it's okay. Maybe take this to consideration and tweak it yourself if you want. If it did work, make sure to accept it, if you have any other questions I'll try to stay active enough to answer them!

0
Not what I was looking for, but I can work with this, thank you! JackTheGamer44666 18 — 4y
Ad

Answer this question