Hi. I'm trying to make a gun(The gun is a mesh) for my game But for some reason my code breaks in game. I'm using the collection service and the run service to detect if a players humanoidrootpart has the tag "D". It works in studio but in game it just breaks??
The error i get is this!
Error:
Players.Herobrinekid1.PlayerGui.LocalScript:69: attempt to index nil with 'Transparency'
And here is my code(In a Localscript by the way):
Code:
game:GetService("RunService").RenderStepped:Connect(function() if Gunme ~= nil then if Collectionse:HasTag(Player.Character.HumanoidRootPart, "D") then Gunme.Transparency = 0 else Gunme.Transparency = 1 end end end)