I am making a loadout GUI and i cant figure out how to clear the inventory of the player.
The code stuff
Select.MouseButton1Click:Connect(function()
if Value1.Value == true
then
M4A1.Parent = Player.Backpack
G17.Parent = Player.Backpack
AmmoBox.Parent = Player.Backpack
end
end)
Value1 = the True/False Value in the Rifleman Button
The thing i want is that the inventory is cleared before the items are given.

3 comments
What do you mean with a remote evnt
Without remote events the tools won't replicate to server, with means the only player that can see the tools is yourself, so you need to use remote events to make the tools replicate (https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events)
I have added the lines of code. and now i get this error: (The Parent property of G17 is locked, current parent: NULL, new parent Backpack)