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

Game portal changing script not working? Roblox

Asked by 4 years ago
Edited 4 years ago

So I'm not sure what I'm doing wrong but the following script gives the following error:

local TeleportService = game:GetService("TeleportService") local gameID = (The Game ID)

function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then TeleportService:Teleport(gameID, player) end end

script.Parent.Touched:connect(onTouched)

Error: 08:31:42.355 - Workspace.Waterfall Level Portal.To Game Script:2: attempt to perform arithmetic (sub) on nil

I'm trying to simply make a portal from one game to another; thanks ahead for your help.

0
Did you put the game ids in? 6zk8 95 — 4y
0
Yes FLIPPER4440 21 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

As far as I know, teleportation between games doesn't work in ROBLOX Studio, and has to be tested in the ROBLOX Player. If you were teleporting from your game's starter place to another place in the game, that will work. If you don't know how to add extra places to your game, there is a tutorial here

Ad

Answer this question