Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My Follow mouse r15 version not working at all?

This is a script im converting to r15 from r6, i think i have everything right, but when i test it nothing happens, what is happening to this script or am i missing something?

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait() ; Character = Player.Character
local UpperTorso = Character:WaitForChild'UpperTorso'
local Neck = UpperTorso:WaitForChild("Neck")
local LeftHand = UpperTorso:WaitForChild("Left Hand")
local RightHand = UpperTorso:WaitForChild("Right Hand")
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.AutoRotate = false
local HMR = Character:WaitForChild("HumanoidRootPart")

local Mouse = Player:GetMouse()

local RC0 = CFrame.new(1, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local RC1 = CFrame.new(-.5, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)

local LC0 = CFrame.new(-1, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local LC1 = CFrame.new(.5, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)

local NeckC0 = Neck.C0
local NeckC1 = Neck.C1

game:GetService("RunService").RenderStepped:connect(function()
    local cf = workspace.CurrentCamera.CFrame.lookVector.Y

    local Kek = CFrame.Angles(0, 0, math.asin(Mouse.Origin.lookVector.Y))
    RightHand.C1 = RC1 * Kek:inverse()
    LeftHand.C1 = LC1 * Kek

    Neck.C0 = NeckC0 * CFrame.Angles(math.asin(Mouse.Origin.lookVector.Y), 0, 0):inverse()
    HMR.CFrame = CFrame.new(HMR.Position, Vector3.new(Mouse.Hit.p.x, HMR.Position.Y, Mouse.Hit.p.z))
end)

1 answer

✓ Accepted answer

hello, I found an error on your script: you forgot the () on

local UpperTorso = Character:WaitForChild'UpperTorso'

Modified script: (Worked on my test)

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait() ; Character = Player.Character
local UpperTorso = Character:WaitForChild('UpperTorso')
local Neck = UpperTorso:WaitForChild("Neck")
local LeftHand = UpperTorso:WaitForChild("Left Hand")
local RightHand = UpperTorso:WaitForChild("Right Hand")
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.AutoRotate = false
local HMR = Character:WaitForChild("HumanoidRootPart")

local Mouse = Player:GetMouse()

local RC0 = CFrame.new(1, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local RC1 = CFrame.new(-.5, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)

local LC0 = CFrame.new(-1, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local LC1 = CFrame.new(.5, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)

local NeckC0 = Neck.C0
local NeckC1 = Neck.C1

game:GetService("RunService").RenderStepped:connect(function()
    local cf = workspace.CurrentCamera.CFrame.lookVector.Y

    local Kek = CFrame.Angles(0, 0, math.asin(Mouse.Origin.lookVector.Y))
    RightHand.C1 = RC1 * Kek:inverse()
    LeftHand.C1 = LC1 * Kek

    Neck.C0 = NeckC0 * CFrame.Angles(math.asin(Mouse.Origin.lookVector.Y), 0, 0):inverse()
    HMR.CFrame = CFrame.new(HMR.Position, Vector3.new(Mouse.Hit.p.x, HMR.Position.Y, Mouse.Hit.p.z))
end)

I didn't understood what exactaly you want with this script, so it can not be what you're expecting, next time, explain a little better =D

Good Luck With your games!

4 comments

0

it still does nothing, nothing happens it suppose to go inside a gun and it works but nothing happens.

0

I found a topic while searching for "roblox follow mouse" maybe it helps: https://scriptinghelpers.org/questions/18625/how-to-make-torso-follow-mouse

0

It's for R6, but I know you can make it work for R15!

0

Yea thxs for helping, this is,the best help,yet anything else would be a request.

This discussion is preserved as it was. New answers, comments, and votes are closed.