It just returns that it doesn't exist and that's the whole point I put an if statement there.
See my code and the error and please tell me why it isn't working, thanks
function backpackPress(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
if player.Character.G36C.Parent == nil then
player.Backpack.G36C.Parent = player.Character
else
player.Character.G36C.Parent = player.Backpack
end
end
end
game.ContextActionService:BindAction("keyPress", backpackPress, false, "1")
Error:
23:44:48.900 - G36C is not a valid member of Model
23:44:48.901 - Stack Begin
23:44:48.901 - Script 'Players.s_nowfall.PlayerGui.clientMain', Line 56
23:44:48.901 - Stack End
23:44:48.902 - ContextActionService: Unexpected error while invoking callback: G36C is not a valid member of Model |