I was recently working on a class selection GUI, and I encountered this problem. "Thompson" is a nil value. Ive never had this problem before. The thing is, it works in Studio but then it errors inside actual ROBLOX?
Heres the code, Ill also link some picture to Imgur that give a more info in case you need it :)
player = game.Players.LocalPlayer
button = script.Parent.Play
button.MouseButton1Click:connect(function()
local Thompson = game.Workspace.Guns:findFirstChild("Thompson")
Thompson:clone().Parent = player.Backpack
Thompson:clone().Parent = player.StarterGear
player.HasClass.Value = true
script.Parent.Visible = false
end)
You'll have to manually copy the link
^Shows were it is in Explorer
^Shows the error inside actual ROBLOX
Thanks and I hope somoene may be able to figure this out :)
ADDON - I tried using, Lighting, Replicated Storage and Server Storage. Lighting and Replicated storage work but then the gun just falls through the map and doesnt stay in the hand. Its weirdd
ADDON 2 - It works when FE is turned off but it doesnt work with FE turned on? Any new ideas?

1 comment
instead of using workspace I would use replicated storage