I am trying to make a teleport to a tower so i want to remove the player (who steps on the pad)'s inventory. here is the code, I am using a regular script because when I use the same code in a local script, It doesnt work and I get no errors. The error i get here is
Workspace.Doors.Door4.Teleport.Clear Gear:2: attempt to index nil with 'Backpack'
This is my code.
script.Parent.Touched:connect(function()
local p = game.Players.LocalPlayer.Backpack
p:ClearAllChildren()
end)
