Client Not Receiving Remote Event!

Hello Fellow Devs! I am having some troubles with the Client Not Picking Up A Remote Event.

  1. What do you want to achieve? I just want, the local script to print(“Picked Up On Client!”)

  2. What is the issue? I am firing a RemoteEvent Called “SendData” And The Client Won’t print it! And I have no clue what’s happening!

  3. What solutions have you tried so far? I have read the whole thing, I can’t find any spelling errors!

There is no errors in the output, there is only “Fired SendData” If you could help it would be amazing!! (The code is down below!)

(This is a script inside ServerScriptService)

game.Players.PlayerAdded:Connect(function(player)
	
	local skinInventory = Instance.new("Folder")
	skinInventory.Name = "SkinInventory"
	skinInventory.Parent = player
	
	local equippedGun  = Instance.new("StringValue")
	equippedGun.Name = "EquippedGun"
	equippedGun.Parent = player
	
	local data = SkinDataStore:GetAsync(player.UserId.."-skin")
	
	if data then
		for i, petName in pairs(data) do
			if game.ReplicatedStorage:WaitForChild("Pets"):FindFirstChild(petName) then
				local stringValue = Instance.new("StringValue")
				stringValue.Name = petName
				stringValue.Parent = player.SkinInventory
			end
		end
		
		game.ReplicatedStorage.SendData:FireClient(player,data)
		print("Fired SendData!")
	else
		print("No Data Found, Must Be a New Player or something happened to the data")
	end
	
end)

(This is a local script inside a ScreenGui)

game.ReplicatedStorage.SendData.OnClientEvent:Connect(function(data)
	print("Picked Up On Client!")
	for i, petName in pairs(data) do
		if game.ReplicatedStorage.Pets:FindFirstChild(petName) then
			addToFrame(game.ReplicatedStorage.Pets:FindFirstChild(petName))
		end
	end
end)

try putting this line and adding it to the pcall

local data = SkinDataStore:GetAsync(player.UserId.."-skin")

-- to

local data

local success, err = pcall(function()
    SkinDataStore:GetAsync(player.UserId.."-skin")
end)

Btw, if this doesn’t work, can you show me the Player.PlayerRemoving script when you save data

That’s the script, you said. I wasn’t very sure how to add it, so I did it this way.

  local data = SkinDataStore:GetAsync(player.UserId.."-skin")

	local data
	
	local success, err = pcall(function()
		if data then
            SkinDataStore:GetAsync(player.UserId.."-skin")
			for i, petName in pairs(data) do
				if game.ReplicatedStorage:WaitForChild("Pets"):FindFirstChild(petName) then
					local stringValue = Instance.new("StringValue")
					stringValue.Name = petName
					stringValue.Parent = player.SkinInventory
					game.ReplicatedStorage.SendData:FireClient(player,data)
	            	print("Fired SendData!")
				else
					print("No Data Found, Must Be a New Player or something happened to the data")
				end
	end)

just change what i did

Just change that 1 line and that it to the pcall as i did
so it looks like this

    local data

    local success, err = pcall(function()
        SkinDataStore:GetAsync(player.UserId.."-skin")
    end)


	if data then
		for i, petName in pairs(data) do
			if game.ReplicatedStorage:WaitForChild("Pets"):FindFirstChild(petName) then
				local stringValue = Instance.new("StringValue")
				stringValue.Name = petName
				stringValue.Parent = player.SkinInventory
			end
		end
		
		game.ReplicatedStorage.SendData:FireClient(player,data)
		print("Fired SendData!")
	else
		print("No Data Found, Must Be a New Player or something happened to the data")
	end
	
end)