Fire ultimate not working

I want the ultimate to go to the mouse position

the ultimate never goes to the correct spot, its always going to the wrong spot… help
ive seatched up other fireball problems but none are helping me…

heres my LOCAL script

local plr = game.Players.LocalPlayer
local chr = plr.Character
if not chr or not chr.Parent then
	chr = plr.CharacterAdded:wait()
end
local hum = chr:WaitForChild("Humanoid")
local mouse = plr:GetMouse()
local qe = script.Projr
local r = hum.Animator:LoadAnimation(script.Radius)
local q = hum.Animator:LoadAnimation(script.Aim)
local x =hum.Animator:LoadAnimation(script.Ult)
local f2 = script.Barrage
local f = hum:LoadAnimation(f2)
local uis = game:GetService("UserInputService")
local eqd = false
local disabling = false
local cd = false
local limittick
local rtik
local rds = false
local etik
local xdt
local rcd = false
local truedotick
local Qdown = false
local ed = false
local lm = false
local rm = false
local utik = false
local ucd = false
local ud = false
local uds = false
local Rdown = false
local ftik
local fd =false
local fds = false
local fcd = false
local circle
script.Parent.Equipped:Connect(function()
	eqd = true
end)
script.Parent.Unequipped:Connect(function()
	eqd = false
end)

local connection  = uis.InputBegan:Connect(function(input, chat)
	if chat then return end
	if input.KeyCode == Enum.KeyCode.Q  and not Qdown and eqd and not cd then
		limittick = tick()
		cd = true
		--script.Sound:Play()
		chr.HumanoidRootPart.Anchored = true
		Qdown = true
		circle = game:GetService("ReplicatedStorage"):WaitForChild("Systemerrorcircle"):Clone()
		circle.Parent = workspace
	end
	if input.KeyCode == Enum.KeyCode.R and not Rdown and eqd and not rcd then
		rtik = tick()
	--	script.Sound:Play()
		chr.HumanoidRootPart.Anchored = true
		Rdown = true
		rcd = true
		circle = game:GetService("ReplicatedStorage"):WaitForChild("Systemerrorcircle"):Clone()
		circle.Parent = workspace
	end
	if input.KeyCode == Enum.KeyCode.E and not ed and eqd then
		etik = tick()
		--script.Sound:Play()
		chr.HumanoidRootPart.Anchored = true
		ed = true
		circle = game:GetService("ReplicatedStorage"):WaitForChild("Systemerrorcircle"):Clone()
		circle.Parent = workspace
		chr.HumanoidRootPart.CFrame = CFrame.new(chr.HumanoidRootPart.CFrame.Position, Vector3.new(mouse.Hit.Position.X, mouse.Hit.Position.Y, mouse.Hit.Position.Z))
		circle.CFrame = chr.HumanoidRootPart.CFrame*CFrame.new(0,0,-5)
		circle.Orientation = chr.HumanoidRootPart.Orientation
		qe:FireServer(mouse.Hit.Position,"E")
		
		wait(1.5)
		chr.HumanoidRootPart.Anchored = false
		if circle then
			circle:Destroy()
			circle = nil
		end
		wait(15)
		ed = false
	end
	if input.KeyCode == Enum.KeyCode.F and not fd and eqd and not fcd then
		ftik = tick()
		f:Play()
		--	script.Sound:Play()
		chr.HumanoidRootPart.Anchored = true
		fd = true
		fcd = true
		circle = game:GetService("ReplicatedStorage"):WaitForChild("Systemerrorcircle"):Clone()
		circle.Parent = workspace
	end
	if input.KeyCode == Enum.KeyCode.X and not ud and eqd and not ucd then
		utik = tick()
		--	script.Sound:Play()
		chr.HumanoidRootPart.Anchored = true
		circle = game:GetService("ReplicatedStorage"):WaitForChild("PUlt"):Clone()
		circle.Parent = workspace
		ud = true
		ucd = true
	end
end)
uis.InputEnded:Connect(function(input, chat)
	if chat then return end
	if input.KeyCode == Enum.KeyCode.Q and eqd and cd and not disabling then
		disabling = true
		Qdown = false
		qe:FireServer(mouse.Hit.Position,"Q")
		wait(1.5)
		chr.HumanoidRootPart.Anchored = false
		if circle then
			circle:Destroy()
			circle = nil
		end
		wait(2)
		cd = false
		disabling = false
	end
	if input.KeyCode == Enum.KeyCode.R and eqd and not rds then
		rds = true
		Rdown = false
		qe:FireServer(chr.HumanoidRootPart.Position,"R")
		if r then r:Stop() end
		wait(1.5)
		chr.HumanoidRootPart.Anchored = false
		if circle then
			circle:Destroy()
			circle = nil
		end
		spawn(function()
			wait(15)
			rcd = false
			rds = false
			end)
	end
	if input.KeyCode == Enum.KeyCode.F and eqd and fcd and not fds then
		fds = true
		if f then f:Stop() end
		fd = false
		wait(1.5)
		chr.HumanoidRootPart.Anchored = false
		if circle then
			circle:Destroy()
			circle = nil
		end
		spawn(function()
			wait(10)
			fcd = false
			fds = false
		end)
	end
	if input.KeyCode == Enum.KeyCode.X and eqd and not uds then
		uds = true
		if circle then
			circle:Destroy()
			circle = nil
		end
		ud = false
		qe:FireServer(chr.HumanoidRootPart.Position,"X")
		if x then x:Stop() end
		wait(1.5)
		
		chr.HumanoidRootPart.Anchored = false
		spawn(function()
		--	wait(30)
			ucd = false
			uds = false
		end)
	end
end)

while true do
	wait()

	if Qdown then
		local diff = (tick() - limittick)
		if disabling then return end
		if diff >= 3.5 and Qdown then
			disabling = true
			Qdown = false
			qe:FireServer(mouse.Hit.Position,"Q")
			wait(1.5)
			chr.HumanoidRootPart.Anchored = false
			if circle then
				circle:Destroy()
				circle = nil
			end
			wait(2)
			cd = false
			disabling = false
		end
		if diff < 3.5 then
			q:Play()
		chr.HumanoidRootPart.CFrame = CFrame.new(chr.HumanoidRootPart.CFrame.Position, Vector3.new(mouse.Hit.Position.X, mouse.Hit.Position.Y, mouse.Hit.Position.Z))
		circle.CFrame = chr.HumanoidRootPart.CFrame*CFrame.new(0,0,-5)
			circle.Orientation = chr.HumanoidRootPart.Orientation
			circle.Size = Vector3.new(circle.Size.X + .5, circle.Size.Y + .5, circle.Size.Z)
		end
	end
	if not Qdown and q then
		q:Stop()
	end
	if Rdown and rcd then
		local diff = (tick() - rtik)
		if disabling then return end
		if diff >= 2 and Rdown and not rds then
			rds = true
			Rdown = false
			qe:FireServer(chr.HumanoidRootPart.Position,"R")
			if r then r:Stop() end
			wait(1.5)
			chr.HumanoidRootPart.Anchored = false
			if circle then
				circle:Destroy()
				circle = nil
			end
			spawn(function()
				wait(15)
				rcd = false
				rds = false
			end)
		end
		if diff < 2 then
			r:Play()
			circle.CFrame = chr.HumanoidRootPart.CFrame+Vector3.new(0,-5,0)
			circle.Orientation = chr.HumanoidRootPart.Orientation+Vector3.new(90,0,0)
			circle.Size = Vector3.new(circle.Size.X + .5, circle.Size.Y + .5, circle.Size.Z)
		end
	end
	if not Rdown and r then
		r:Stop()
	end
	if fd and fcd then
		local diff = (tick() - ftik)
		if fds then return end
		if diff >= 5 and fd then
			fds = true
			if f then f:Stop() end
			fd = false
			wait(1.5)
			chr.HumanoidRootPart.Anchored = false
			if circle then
				circle:Destroy()
				circle = nil
			end
			spawn(function()
				wait(10)
				fcd = false
				fds = false
			end)
		end
		if diff < 5 then
			if fd and not f then f:Play() end 
			f:GetMarkerReachedSignal("Left"):Connect(function() if lm then return end lm = true qe:FireServer(mouse.Hit.Position,"F", "Left") wait(0.10) lm = false end)
			f:GetMarkerReachedSignal("Right"):Connect(function() if rm then return end rm = true qe:FireServer(mouse.Hit.Position,"F", "Right")wait(0.10) rm = false end)
			chr.HumanoidRootPart.CFrame = CFrame.new(chr.HumanoidRootPart.CFrame.Position, Vector3.new(mouse.Hit.Position.X, mouse.Hit.Position.Y, mouse.Hit.Position.Z))
			circle.CFrame = chr.HumanoidRootPart.CFrame*CFrame.new(0,0,-5)
			circle.Orientation = chr.HumanoidRootPart.Orientation
		end
	end
	if ud then
		local diff = (tick() - utik)
		if uds then return end
		if diff >= 10 and ud then
			x:Stop()
			uds = true
			ud = false
			if circle then
				circle:Destroy()
				circle = nil
			end
			qe:FireServer(mouse.Hit.Position,"X")
			wait(1.5)
			chr.HumanoidRootPart.Anchored = false
		--	wait(2)
			ucd = false
			uds = false
		end
		if diff < 10 then
			x:Play()
			chr.HumanoidRootPart.CFrame = CFrame.new(chr.HumanoidRootPart.CFrame.Position, Vector3.new(mouse.Hit.Position.X, mouse.Hit.Position.Y, mouse.Hit.Position.Z))
			circle.CFrame = chr.HumanoidRootPart.CFrame*CFrame.new(0,85,0)
			circle.Orientation = Vector3.new(0.98, 7.44, 82.56)
		end
	end
end

and heres the serverscript

 local r = script.Parent
local namew = {}
local range = 2000
local debris = game:GetService("Debris")

local function CreateBeam(origin, direction)
	local midpoint = origin + direction/2 

	local part = Instance.new("Part")
	part.Parent = game.Workspace
	part.Anchored = true 
	part.CanCollide = false 

	part.Material = Enum.Material.Neon
	part.BrickColor = BrickColor.new("Neon orange")

	part.CFrame = CFrame.new(midpoint, origin)
	part.Size = Vector3.new(.25, .25, direction.magnitude)
	
	script.Ignite5Sun:Clone().Parent = part
	script.Ignite5Sun:Clone().Parent = part
	script.Ignite5Sun:Clone().Parent = part
	script.Ignite5Sun:Clone().Parent = part
	script.Ignite5Sun:Clone().Parent = part
	debris:AddItem(part, 1.5)
end 

r.OnServerEvent:Connect(function(plr, mpos, what)
	local chr = plr.Character
	local rp = chr.HumanoidRootPart
	if what == "Q"then
		local fb = game.ServerStorage["$Y$|3M 3RR0R"]:Clone()
		fb.Parent = workspace
		fb.CFrame = CFrame.new(rp.Position, mpos)*CFrame.new(0,0,-15)
		local vel = Instance.new("BodyVelocity", fb)
		vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		vel.Velocity = CFrame.new(chr.HumanoidRootPart.Position,mpos).LookVector*200
		game.Debris:AddItem(fb,3)
		local dmged = false
		fb.Hitbox.Touched:Connect(function(hit)
			if dmged then return end
			dmged = true
			fb.Anchored = true
			fb.Hitbox.Anchored = true
			if fb:FindFirstChild("Attachment")then
				fb.Attachment:Destroy()
			end
				local boomboom = game.ServerStorage["$Y$|3M 3RR0R -BOOMBOOM-"]:Clone()
				boomboom.Parent = workspace
			boomboom.CFrame = fb.CFrame
			local result = fb:GetTouchingParts()

			for i,v in pairs(game.Workspace.Chars:GetChildren()) do
				local m = (v:IsA("Model") and v) or nil
				if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= chr then
					if (fb.Hitbox.Position - m.HumanoidRootPart.Position).magnitude <= 15 then
							m.Humanoid:TakeDamage(100)
						end
				end
			end
				spawn(function()
				wait(2.5)
					boomboom:Destroy()
				fb:Destroy()
				dmged = false
				end)
		end)
	elseif what == "R" then
		local chr = plr.Character
		local rp = chr.HumanoidRootPart
		local fb = game.ServerStorage["SysErrR"]:Clone()
		fb.Parent = workspace
		fb.CFrame = rp.CFrame
		fb.Orientation = Vector3.new(0, 0, 90)
		game.Debris:AddItem(fb,3)
		local touched = false
		fb.Touched:Connect(function(hit)
			if touched == false then
				touched = true
				for i,v in pairs(game.Workspace.Chars:GetChildren()) do
				local m = (v:IsA("Model") and v) or nil
				if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= chr then
						if (fb.Position - m.HumanoidRootPart.Position).magnitude <= 50
						then
							m.Humanoid:TakeDamage(100)
						end
				end
			end
				spawn(function()
					wait(3.5)
					fb:Destroy()
				end)
			end
			
		end)
	elseif what == "E"then
	local direction = (mpos - rp.Position).Unit * range  

	local result = workspace:Raycast(rp.Position, direction)

	if result then 
		local character = result.Instance.Parent 
		local humanoid = character:FindFirstChild("Humanoid")

		if humanoid and humanoid ~= plr.Character.Humanoid then 
			humanoid:TakeDamage(10000)
		end

	end

		CreateBeam(rp.Position, direction)
	elseif what == "F"then
			local fb = game.ServerStorage["SysF"]:Clone()
			fb.Parent = workspace
			fb.CFrame = CFrame.new(rp.Position, mpos)*CFrame.new(0,0,-10)
			local vel = Instance.new("BodyVelocity", fb)
			vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			vel.Velocity = CFrame.new(rp.Position,mpos).LookVector*200
			game.Debris:AddItem(fb,3)
			local dmged = false
			fb.Hitbox.Touched:Connect(function(hit)
			if dmged or hit.Name == ("SysF" or"SysFBoom")  then return end
			dmged = true
			fb.CanTouch = false
				fb.Anchored = true
				fb.Hitbox.Anchored = true
				if fb:FindFirstChild("Attachment")then
					fb.Attachment:Destroy()
				end
				local boomboom = game.ServerStorage["SysFBoom"]:Clone()
				boomboom.Parent = workspace
				boomboom.CFrame = fb.CFrame
				local result = fb:GetTouchingParts()

				for i,v in pairs(game.Workspace.Chars:GetChildren()) do
					local m = (v:IsA("Model") and v) or nil
					if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= chr then
					if (fb.Hitbox.Position - m.HumanoidRootPart.Position).magnitude <= 7.5 then
							m.Humanoid:TakeDamage(50)
						end
					end
				end
				spawn(function()
					wait(2.5)
					boomboom:Destroy()
					fb:Destroy()
					dmged = false
				end)
		end)
	elseif what == "X" then
		local fb = game.ServerStorage["Ult"]:Clone()
			fb.Parent = workspace
			fb.CFrame = CFrame.new(chr.Head.Position)*CFrame.new(0,75,0)
		local vel = Instance.new("BodyVelocity", fb)
		vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		vel.Velocity = (rp.Position - mpos).unit * -175
			game.Debris:AddItem(fb,15)
			--[[fb.Touched:Connect(function(hit)
				if dmged then return end
				dmged = true
				fb.Anchored = true

				local boomboom = game.ServerStorage["UltBoom"]:Clone()
				boomboom.Parent = workspace
			boomboom.CFrame = fb.CFrame
			fb:Destroy()
				for i,v in pairs(game.Workspace.Chars:GetChildren()) do
					local m = (v:IsA("Model") and v) or nil
					if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= chr then
						if (fb.Hitbox.Position - m.HumanoidRootPart.Position).magnitude <= 150 then
							m.Humanoid:TakeDamage(10000)
						end
					end
				end
				spawn(function()
					wait(2.5)
					boomboom:Destroy()
					fb:Destroy()
					dmged = false
				end)
			end)]]
	end
end)

Is anyone able to help? because i cant seem to fix this at all…

Nevermind! i managed to use mouse.hit instead of mouse.hit.position, It worked, i say!