I have a gun model that works fine, I added a Click detector and a script to make it so when I click the gun it goes from the workspace to the Backpack, when I clicked on the gun in output it printed Glock is not a valid member of Workspace even though as it I read that I saw the gun in workspace, and yes the gun is named exactly Glock,
Below is output yelling at me whilst clicking gun
https://gyazo.com/f67132c50fad4f24ba89e43ac5bfdb73
Below is the Glock in workspace
https://gyazo.com/f67132c50fad4f24ba89e43ac5bfdb73
local clickDetector = script.Parent
local function onMouseClick(player)
wait(0.7)
game.Workspace.Glock = player.Backpack
end
clickDetector.MouseClick:connect(onMouseClick)
It is a short script and I may not be fully done with it, as the output said the problem is line 6 as Glock isn't in workspace even though it is, so my question is, is Roblox trying to pull Paranormal Investigations or am I missing something very obvious?

1 comment
You forgot
.Parenton line 6, aftergame.Workspace.Glock. Also, you should be checking if it exists before trying to parent it anyway.