Fireball wont move to player

So I’m making a boss fight, and i made a fireball ability, and i want the fireball to shoot player, and i thought about tween, so i used it and it doesnt really work…

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humr = char:WaitForChild("HumanoidRootPart")
		
		local fireCount = 0
		
		local function shootfireball()
			local cfire = Fire:Clone()
			cfire.Parent = workspace
			cfire.CFrame = mouth.CFrame
			
			local ts = game:GetService("TweenService")
			local fireballtweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear)
			local fireballtween = ts:Create(Fire, fireballtweenInfo, {CFrame = humr.CFrame})
			
			fireballtween:Play()
		end

		while true do
			task.wait(2)
			if fireCount < 4 then
				ColorTween(mouth, Color3.new(1, 0.635294, 0), 0.5)
				ColorTween(leye, Color3.new(1, 0.635294, 0), 0.5)
				ColorTween(reye, Color3.new(1, 0.635294, 0), 0.5)
				wait(0.3)
				Attackanim:Play()
				mouth2.Transparency = 0
				mouth.Transparency = 1
				wait(0.2)
				shootfireball()
				body.Fire:Play()
				print("Fireball")
				fireCount += 1
				wait(0.1)
				mouth2.Transparency = 1
				mouth.Transparency = 0
				ColorTween(mouth, Color3.new(0, 1, 0), 0.5)
				ColorTween(leye, Color3.new(0, 1, 0), 0.5)
				ColorTween(reye, Color3.new(0, 1, 0), 0.5)
			elseif fireCount == 4 then
				ColorTween(mouth, Color3.new(1, 0.635294, 0), 0.5)
				ColorTween(leye, Color3.new(1, 0.635294, 0), 0.5)
				ColorTween(reye, Color3.new(1, 0.635294, 0), 0.5)
				wait(0.3)
				Attackanim:Play()
				mouth2.Transparency = 0
				mouth.Transparency = 1
				wait(0.2)
				body.Fire:Play()
				print("Green")
				fireCount = 0
				wait(0.1)
				mouth2.Transparency = 1
				mouth.Transparency = 0
				ColorTween(mouth, Color3.new(0, 1, 0), 0.5)
				ColorTween(leye, Color3.new(0, 1, 0), 0.5)
				ColorTween(reye, Color3.new(0, 1, 0), 0.5)
			end
		end
	end)
end)

It does not give me any error, it just wont move to the player.

this doesn’t belong to code review, code review is only for already working code

just mark any answer as the solution, ideally write the solution and mark yourself as the answer

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.