Wearable Helmet Showing in first person

Made a simple helmet that attaches to the players head, and gives hp. but when you wear the helmet it shows the model in first person

Honestly i have no clue on how to even start on how to make the helmet invisible so any advice would be awesome

Heres the headattachment script if its even useful

local tool = script.Parent
local remote = tool:WaitForChild("RemoteEvent")
local player = game.Players.LocalPlayer

wait()
local character = player.Character
local humanoid = character.Humanoid
local humanoidrootpart = character.HumanoidRootPart
local Torso = character.Head

tool.Activated:Connect(function()
	
	remote:FireServer(humanoidrootpart, Torso)
	
end)


Parent the hat to the character, if that doesn’t work then you will have to use LocalTransparencyModifiers

how would i parent the hat to the character, not sure how to do that

you would reference the hat object then state:

hatObject.Parent = player.Character

it depends on what you’re receiving on the server from this

line

I dont know how i could use that line, first time hearing it xd

That script just fires an event to the server, can you share the server script that handles the fired event?

make it transparent when you go first person

1 Like

put this in a local script inside the tool

local tool = script.parent
local head = game.Players.LocalPlayer.Character:FindFirstChild("Head")
game:GetService("RunService").Heartbeat:Connect(function()
    if head.LocalTransparencyModifier == 1 then -- if head is invisible means player in firstperson
        -- In first person view
        for i, v in pairs(tool:GetDescendants())
            if v:IsA("BasePart") then
                if v.LocalTransparencyModifer == 1 then return end -- wont run again if its already invisible
                v.LocalTransparencyModifier = 1 -- makes the descendant invisible only for player
            end
        end
    else
        for i, v in pairs(tool:GetDescendants())
            if v:IsA("BasePart") then
                 v.LocalTransparencyModifier = 0 -- makes it visible when out of 
            end
        end
    end
end)
1 Like

You can set the camera minimum zoom distance in starterplayer to something a bit further so that it zooms in to just outside the view of the hat in first person.

Another option is to decrease the players field of view when they are wearing the helmet, done via script in the cameramode.

I forgot to tell you guys this, but I was able to fix the helmet myself with all of your advice, thank you so so much for the help!

1 Like