function mask(key) if string.lower(key)=='m' and script.Parent.Folder.Value.Value==1 then h = Instance.new("Hat") p = game.Workspace.Mask2:clone() h.Name = "Space Hat" p.Parent = h p.Position = script.Parent:FindFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(2, 0.4, 1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true p.Anchored = false h.Parent = script.Parent h.AttachmentPos = Vector3.new(0, -0.5, 0.5) h.AttachmentUp = Vector3.new(0, 0.147, 0.989) end end MyMouse=game.Players.LocalPlayer:GetMouse() MyMouse.KeyDown:connect(mask)
due to some roblox newtork loading complications, sometimes stuff may load faster or slower than the others, even if you use a waitForChild(), the way i fixed it is to make a script to disable and enable it to make it work.
Make sure that the script is a "LocalScript" Instead of "Script" only if it has "game.Players.LocalPlayer"