Server dictonary not same as client dictonary when sent over only on mobile

print("Cheese")

just a norm local script with just print cheese

No when you print out the table.

The whole code from the time you get it from FireServer till you print it

local function SetUpLevelsInlevelSelect ()
	local PlayerLevelsTable = GetLevelsFromServer:InvokeServer()
	
	for Num = 1,2,1 do
		local LevelFrame
		if Num == 1 then
			LevelFrame = LevelFrame1 
		else 
			LevelFrame = LevelFrame2
		end
		
		for _, Gui in pairs(LevelFrame:GetChildren()) do
			if Gui:IsA("ImageButton") then
				Gui:Destroy()
			end
		end
	end

	local SendingPlayer = false

	for LevelNum, LevelInfo in pairs(PlayerLevelsTable) do
		print(LevelNum)
		print(LevelInfo)
		
		local LevelFrame
		
		if tonumber(LevelNum) == nil then
			return
		end
		
		if tonumber(LevelNum) > 9 then
			LevelFrame = LevelFrame2
		else
			LevelFrame = LevelFrame1
		end
		
		local LevelGui = LevelTemplate:Clone()
		LevelGui.LevelNum.Text = LevelNum
		LevelGui.Name = "Level" .. LevelNum
		LevelGui.Image = LevelInfo.ImageId

		if LevelInfo.Unlocked == false then

			local LockImage = Instance.new("ImageLabel",LevelGui)
			LockImage.Size = UDim2.new(1,0,1,0)
			LockImage.BackgroundTransparency = 0.5
			LockImage.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
			LockImage.ImageTransparency = 0.2
			LockImage.Image = "rbxassetid://7960290154"
			LockImage.ImageColor3 = Color3.fromRGB(247, 255, 246)
		end

		LevelGui.Parent = LevelFrame

		LevelGui.MouseButton1Down:Connect(function()
			
			if LevelInfo.Unlocked == false then return end
			
			if SendingPlayer == false then SendingPlayer = true else return end
			
			LevelTeleportEvent:FireServer(tonumber(LevelNum))

			PutBackLevelSelectGui()
		end)
	end
	
end
1 Like

Iā€™ve looked through everything you sent and I canā€™t find any problem.

My suggestion is put some prints on the server code to validate what should be sent is being sent. Iā€™m guessing youā€™ll have to track something down on the server.

Put a print SavedLevels[player] right before you return it to the client and see what prints

I tried that as well but it just printed everthing as expected on the server

Well the last thing I could think of is maybe lua thinks itā€™s a mixed table. (It shouldnā€™t)

Try switching out every table key for a proper word instead of string number

1 ā†’ one

Also you can get rid of the brackets and quotes when you do that

sounds like it might work I`ll try it

Thatā€™s the only thing that can be the problem. Sorry for not telling you earlier I just assumed you can have string numbers as keys.

1 Like

now the stragest of things have happened now it only shows Four and nothing eles not even the player on level I`m just at a pure lost at this point

1 Like

I have no idea what to tell you then.

I have to go now. The last thing Iā€™ll say is make sure the table is not mixed, each value is able to be replicated, use pairs when looping through them, make sure there is no user input service is touch enabled code messing things up.

Other than that I have literally no idea.

1 Like

Thanks for the help tho! it was very helpfull!

1 Like

After a bunch more tries and fails I just tried getting rid of the numbers on the sideā€¦ and it worked for some dumb reason I dont understand!!!

Heres the working table that can be sent over and works if you wondered
local NewPlayerData = {
		
		PlayerOnLevel = 0,
		
		{ImageId = "http://www.roblox.com/asset/?id=8062553122", Unlocked = true, Difficulty = Easy,Tip = "Press C or click the flag icon to put down a checkpoint for the ball and each level got a max"},
		{ImageId = "", Unlocked = false, Difficulty = Easy, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Easy, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Easy, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Easy, Tip = ""},
		{ImageId = "http://www.roblox.com/asset/?id=8062546001", Unlocked = true, Difficulty = Meduim, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Meduim, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Meduim, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Meduim, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Meduim, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Hard, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Hard, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Hard, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Hard, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Hard, Tip = ""},
		{ImageId = "", Unlocked = false, Difficulty = Boss, Tip = ""},
		
	}

EDIT: so PlayerOnLevel didnt send over I had to place it in a array as well

and also thanks batteryday for being a very good help!!