TeleportData Table's children are nullified!

2nd place script shoud look like this:

game:GetService("TeleportService").LocalPlayerArrivedFromTeleport:Connect(function(TeleportGui,TeleportData)
local DecodedData = game:GetService("HTTPService"):JSONDecode(TeleportData["Data"])
wait(0.1)
print(DecodedData.Name)
print(DecodedData.ClassName)
print(DecodedData:GetChildren())

nvm your one is good because this one supposed to be for messagingservice mb

nvm use your own script it should work fine this one is a script for messagingservice

You can’t pass instances in teleport data, datastores, messaging service, or HTTP service.

1 Like

Do you know how I can pass the data in that case?

use table? if you aren’t using it already

You could instead send the data that you got from datastores, to identity the Unit the player has equipped. The other server could identity it just like the first server.

@madonchik123 @avodey
So I think it’s working but I got this error:

could you show what line that is

game:GetService("TeleportService").LocalPlayerArrivedFromTeleport:Connect(function(TeleportGui,DataTable)
	wait(0.1)
	print(DataTable:GetChildren())
	print(1)

3rd line!

Nevermind.
I had to do a pairs loop!

image

game:GetService("TeleportService").LocalPlayerArrivedFromTeleport:Connect(function(TeleportGui,DataTable)
	wait(0.1)
	print(1)
	for i,v in pairs(DataTable) do
		print(v)
		print(2)
		if game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").BuyCats.UnitSelect[tostring(v)] then
			print(3)
			if v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").BuyCats.UnitSelect[tostring(v)]
				Unit.Shop.Disabled = true
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		elseif game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.Storage[tostring(v)] then
			print(3)
			if v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.Storage[tostring(v)]
				if Unit:FindFirstChild("Shop") then
					print(4.5)
					Unit.Shop.Disabled = true
				end
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		elseif game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").UnitGacha.Storage[tostring(v)] then
			print(3)
			if v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").UnitGacha.Storage[tostring(v)]
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		end
	end
end)

It only printed one value and stopped at this line:

			if v.Value >= 1 then

EDIT: I did not have the Red cat (I’m doing all of this in a testing place so yeah) but it did not continue to the next one, which I have!
What do I do?

maybe because it tried to get value from a basepart?

try this

game:GetService("TeleportService").LocalPlayerArrivedFromTeleport:Connect(function(TeleportGui,DataTable)
	wait(0.1)
	print(1)
	for i,v in pairs(DataTable) do
		print(v)
		print(2)
		if game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").BuyCats.UnitSelect[tostring(v)] then
			print(3)
			if v:IsA("NumberValue") and v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").BuyCats.UnitSelect[tostring(v)]
				Unit.Shop.Disabled = true
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		elseif game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.Storage[tostring(v)] then
			print(3)
			if v:IsA("NumberValue") and v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.Storage[tostring(v)]
				if Unit:FindFirstChild("Shop") then
					print(4.5)
					Unit.Shop.Disabled = true
				end
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		elseif game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").UnitGacha.Storage[tostring(v)] then
			print(3)
			if v:IsA("NumberValue") and v.Value >= 1 then
				print(4)
				local Unit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").UnitGacha.Storage[tostring(v)]
				Unit.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect
				wait(0.1)
				local OwnedUnit = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui").YourCats.UnitSelect:WaitForChild(tostring(Unit))
				if OwnedUnit then
					print(5)
					OwnedUnit.LocalScript.Disabled = false
				end
			else

			end
		end
	end
end)

The folder only has NumberValues tho

I still need help!
Can anyone help me?

There is an open sourced module that converts the table into a variable and from there you could sent it to another script with RemoteEvents/Bindable functions:

1 Like

Tried it out.
So I basically replaced if v.Value >= 1 with a remote event to access the server to check from there.
this is the replacement for that line!

This is the result:
image

Server script:

local True = true
local repr = require(3148021300)
game.ReplicatedStorage.CheckValue.OnServerEvent:Connect(function(Player,v,DataTable)
	print(repr(DataTable))
	print(v)	
	if v:IsA("NumberValue") and v.Value >= 1 then
		print(v.."Is available!")
		game.ReplicatedStorage.CheckValue:FireClient(Player,True)
	else
		game.ReplicatedStorage.CheckValue:FireClient(Player)
	end	
end)

I’m still stuck with this problem!
Anyone?