I'm running a remote event through replicated storage at the client to clear their backpack.

Local script:

local Backpack = game:GetService("Players").LocalPlayer:WaitForChild("Backpack")
local ClearBackpackEvent = game:GetService("ReplicatedStorage"):WaitForChild("ClearBackpack")
ClearBackpackEvent.OnClientEvent:Connect(function()
	
	print("Recieve")
	Backpack:ClearAllChildren()
	
end)

Server-side script:

wait(10) --Waiting for the game to load
local Event= game:GetService("ReplicatedStorage"):WaitForChild("ClearBackpack")
Event:FireClient(game:GetService("Players").wwwaylon09)

I received the local script's printed message in my output bar, yet the players backpack doesn't get cleared.

Does anyone know why?

Solution:

For whatever reason, the players backpack does not register with any children when called from the player, I put the local script in the character model and it worked fine. Possible engine bug?

3 comments

0

i think its :ClearChildren()

0

not :ClearAllChildren

0

Nope, if it was a mistype it would error, I can confirm it is :ClearAllChildren()