How to put tool on the player's head?

Hello! I would like to know what is wrong in my code, I want the night vision tool to appear in the player’s head, how can I do that?

localscript:

local tool = script.Parent
local equipped = false
local UID = game:GetService("UserInputService")

local player = game.Players.LocalPlayer
local char = player.Character
tool = char.Head.CFrame


tool.Equipped:Connect(function()
    equipped = true
end)

tool.Unequipped:Connect(function()
    equipped = false
end)

local isActivated = false

UID.InputBegan:Connect(function(key,isTyping)
    if equipped == true then
        print("tool equipped")
        if key.KeyCode == Enum.KeyCode.N then
            isActivated = not isActivated
            if (isActivated) then
                pcall(function()
                    local StarterGui = game:GetService("StarterGui")
                    StarterGui:SetCore("TopbarEnabled", false)


                end)

                local frame = game:GetService("Players").LocalPlayer.PlayerGui
                print("Activated.")
                -- Config 1
                wait(.1)
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 0.1
                wait(.1)
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 0.15
                -- Config 2
                wait(.1)
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 0.25
                wait(.1)
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 0.4
                wait(.1)
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 0.6 
            else    
                pcall(function()
                    local StarterGui = game:GetService("StarterGui")
                    StarterGui:SetCore("TopbarEnabled", true)
                end)
                local frame = game:GetService("Players").LocalPlayer.PlayerGui
                frame.Screen:FindFirstChild("NightConfig").BackgroundTransparency = 1
                print("no activated.")
            end
        end
    end
end)

Project images:

image

image

I believe that to make it on their head, you need to change the tool’s GripPos property. Changing it on the Y axis will make it higher, and then play around with the Z and X axis until it is infant of their eyes.

Something like this?

tool.GripPos.Y = 5
tool.GripPos.X = 5

i try doing that and it doesn’t work

Did the tool move at all, or did it stay in their hand?

It is still in the hand, it did not move

Did you change it through a script or through the properties tab? You want to do it through the properties tab.

1 Like

Wait, why would you want NVGs as a tool? Personally, I’d just make them an accessory and then implement the functionality with PlayerScripts.

1 Like

You could also create a simple animation, set the priority to action and relocate the tool to the player’s head and then play the animation every time it’s equipped.

A simple way would just to use an Accessory or you could turn RequiresHandle off of your tool then CFrame and Weld the mesh to the players head.