Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Data not transferring between games properly?

So I have a teleport GUI in game 1 that is supposed to send data to game 2. But it won´t send the data to game 2, but will teleport me. Game 1 GUI:

script.Parent.MouseButton1Click:Connect(function()
game:GetService(¨TeleportService¨):Teleport((mygameid),game.Players.LocalPlayer, script.Parent.TextBox.Text)
end)

Game 2 GUI

local Data = game:GetService(¨TeleportService¨):GetLocalPlayerTeleportData()

script.Parent.Text = (Data) --Parent is a TextLabel if anyone was wondering

Does anyone know a solution to this problem?

2 comments

0

if your in studio, it won't send the data ;p

0

its not sending the data in game either

1 answer

You have to teleport the data with the player, I also edited your code a bit.

send

local players = game:GetService("Players")
local player = players.LocalPlayer
local teleportData = {
	script.Parent.TextBox.Text
}

script.Parent.MouseButton1Click:Connect(function()
	game:GetService(¨TeleportService¨):Teleport(mygameid, player,  teleportData)
end)

get

local TeleportService = game:GetService("TeleportService")
local Data = TeleportService:GetLocalPlayerTeleportData()

if teleportData then
	script.Parent.Text = Data
end

accept if this helped :)

This discussion is preserved as it was. New answers, comments, and votes are closed.