Still have questions? Join our Discord server and get real time help.
0

# Making mousehit more accurate?

Ive got an issue with things not really moving towards the mouse very accurately. They will move in the general direction but not where the mouse is aiming, forcing players to aim really low. Is there a better way to send something towards where the player is aiming?

local script:

function Keys(key)
local Key = key:lower()
if key == "z" then
script.ZMove:FireServer(mouse.Hit)
end
if key == "x" then
script.XMove:FireServer(mouse.Hit)
end
if key == "c" then
script.CMove:FireServer(mouse.Hit)
end
if key == "b" then
script.BMove:FireServer(mouse.Hit)
end
if key == "v" then
script.VMove:FireServer(mouse.Hit)
end
end


(this isnt the whole script but it's the relevant parts)

server script:

            local Lance1 = game.ReplicatedStorage.Fruits.FlameStuff.FireLance:Clone()
Lance1.CFrame = Player.Character.HumanoidRootPart.CFrame*CFrame.new(1,0,0)
Lance1.Parent = Player.Character.AttackFolder
local Lance2 = game.ReplicatedStorage.Fruits.FlameStuff.FireLance2:Clone()
Lance2.CFrame = Player.Character.HumanoidRootPart.CFrame*CFrame.new(-1,0,0)
Lance2.Parent = Player.Character.AttackFolder
Lance1.MeleeDamage.Disabled = false
Lance2.MeleeDamage.Disabled = false
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = mousehit.LookVector*80
BV.Parent = Lance1
local BV2 = BV:Clone()
BV2.Parent = Lance2


(again not the whole script, but the relevant parts)