Error where script needs a ) to continue

Hello!

So I’m making another boss fight but while making it I ran into a very weird error. For some reason it needs an extra ) at a wait command when I already have one there. Can someone help me fix this? Here’s the code.

local function fireballChallenge()
	
	for i=1,3 do
		
		for i,player in pairs(game.Players:GetPlayers()) do
			if player.Character then 
				local fireball = game.ReplicatedStorage.Fireball:Clone()
				local target = game.ReplicatedStorage.Target:Clone()
				
				target.Parent = game.Workspace
				target.CFrame = (player.Character.HumanoidRootPart.CFrame - Vector3.new(0,3,0)) + CFrame.Angles(0,0, math.rad(90)
				
				wait(0.5) -- Error here!
				
				fireball.Parent = game.Workspace
				fireball.CFrame = target.CFrame + Vector3.new(0,60.0)
				
				wait(2)
				
				target:Destroy()
			end
		end
		wait(1)
		
	end
	
end

while wait(5) do
	
	fireballChallenge()
	
end

-HystericalBinky

You forgot a ) at the end of that. The error is on the next line because it is trying to put the wait in the CFrame.

1 Like

Now it’s giving the same error but at line 12.

nvm din’t understand what u ment at 1st thanks!

1 Like