Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make my head look at the cursor?

Asked by 10 years ago

Hello

Im working on a flashlight script here is how it works:

It welds a flashlight and an arm to the players head.

Here is the problem: I want the flashlight to follow the cursor I dont know how to do that.

So if any of you can help me that would be awesome.

Thanks

And if you need to see the script for some reason, here you go

wait()
local player = script.Parent.Parent
cam = game.Workspace.CurrentCamera

rig = game.ServerStorage.Rig:Clone()
rig.Parent = cam

function Weld(a, b)
    local weld = Instance.new("Weld")
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    weld.C1 = CFrame.new(1.2, -0.5, -2.7)*CFrame.Angles(0, -1.55, 1.5)
    weld.Parent = a
    return weld
end

w = Weld(rig.Main, player.Character.Head)
0
Anyone? jbjgang2 37 — 10y

Answer this question