I have this little fire ball script with the use of mousehit and the position of the mouse
but when I push f the fire ball shoots "near" the mouse position but not on it! (its not accurate)
game.Workspace.firedfire.OnServerEvent:Connect(function(player, suse, mousehit)
local mouse = player:GetMouse()
local hithum = false
local char = player.Character or player.CharacterAdded:wait()
local hum = char.Humanoid
local alrt = false
suse = true
--char.HumanoidRootPart.CFrame = CFrame.new(char.HumanoidRootPart.Position,char.HumanoidRootPart.Position + mousehit.lookVector)
local iceb = game.ReplicatedStorage.fireball:Clone()
iceb.Parent = char
iceb.CFrame = char.HumanoidRootPart.CFrame*CFrame.new(0,3,-10)
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = mousehit.lookVector*70--.HumanoidRootPart.CFrame.lookVector*70
bv.Parent = iceb
iceb.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") and hithum == false then
hithum = true
iceb.BodyVelocity:Destroy()
iceb.Anchored = true
hit.Parent.Humanoid:TakeDamage(15)
local fire = Instance.new("Fire")
fire.Size = 8
fire.Parent = hit.Parent.HumanoidRootPart
for i = 1,5 do
wait()
iceb.Size = iceb.Size + Vector3.new(1,1,1)
end
wait(.5)
iceb:Destroy()
for i = 1,10 do
wait(.5)
hit.Parent.Humanoid:TakeDamage(2)
end
fire:Destroy()
end
-- fir:Destroy()
end)
wait(2)
suse = false
end)
How do I make the fire ball shoot "Accurately AT The Mouse"!?

1 comment
GetMouse can only be called on the client.