Need help transferring data from a place to another place

DATA:

	local data = Instance.new("Folder")
	data.Name = "data"
	data.Parent = player
	
	local OwnedMutations = Instance.new("Folder")
	OwnedMutations.Parent = data
	OwnedMutations.Name = "OwnedMutations"
	
	local Normal = Instance.new("BoolValue")
	Normal.Name = "Normal"
	Normal.Value = true
	Normal.Parent = OwnedMutations
	
	game.ReplicatedStorage.Bindables.RequestData.Event:Connect(function()
		game.ReplicatedStorage.Bindables.SendBackData:Fire(data)
	end)
end)

Sending data:

	print("Received teleport data:", data)
	local reservedCode = tps:ReserveServer(placeId)
	local teleportOptions = Instance.new("TeleportOptions")
	teleportOptions:SetTeleportData(data)
	tps:TeleportPartyAsync(placeId, playersToTeleport, teleportOptions)
end)

Receiving data:

	local joinData = player:GetJoinData()

	if joinData then
	
		local dataFolder = joinData:Get("TeleportData") 
		if dataFolder then
			print("TeleportData folder contents:")
			for _, child in ipairs(dataFolder:GetChildren()) do
				print("Found child: " .. child.Name)

				if child:IsA("Folder") then
					print("Folder: " .. child.Name)
					for _, grandchild in ipairs(child:GetChildren()) do
						if grandchild:IsA("ValueBase") then
							print(grandchild.Name .. ": " .. tostring(grandchild.Value))
						end
					end
				elseif child:IsA("ValueBase") then
					print(child.Name .. ": " .. tostring(child.Value))
				end
			end
		else
			print("No TeleportData folder found!")
		end
	else
		print("No join data!")
	end
end)

I’m sorry if this sounds dumb but I really need help with this.

2 Likes

Datastore (if you thought of that idea) won’t let you share data between two different games
Do an external datastore with HTTPService instead.

1 Like
1 Like

It should be joindata:GetTeleportData() instead of joindata:Get("TeleportData")

3 Likes

He’s teleporting between two different places, not another game. Nevertheless, using HTTP Service is a good idea

2 Likes

I have found the solution.

tps:TeleportPartyAsync doesn’t save
tps:TeleportAsync saves.

with

TeleportService:GetLocalPlayerTeleportData()

And I made OwnedMutations go into a table named data.

local data = {
		OwnedMutations = {"Anything"}
	}

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