ticks = script.Parent.Ticks.Value
function touch(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		local char = hit.Parent
		local plar = game.Players:GetPlayerFromCharacter(char)
		if plar.TeamColor == BrickColor.new("Maroon") then
			
			if script.Parent.BrickColor == BrickColor.new("Navy blue")then
				local control = 0
					if script.Parent:GetTouchingParts(hit) ~= nil then
					ticks = ticks + 1
					elseif script.Parent:GetTouchingParts(hit) == nil then
						ticks = ticks 
					end
					
					local thisTick = ticks
					
					wait(10)
					
					if thisTick <= control then
						script.Parent.BrickColor = BrickColor.new("Maroon")
						ticks = 0
						else return
					end
					else return
				end
		end
		
		if plar.TeamColor == BrickColor.new("Navy blue") then
			if script.Parent.BrickColor == BrickColor.new("Maroon") then 
				local control = 0
					if script.Parent:GetTouchingParts(hit) ~= nil then
					ticks = ticks + 1
					elseif script.Parent:GetTouchingParts(hit) == nil then
						ticks = ticks 
					end
					
					local thisTick = ticks
					
					wait(10)
					
					if thisTick <= control then
						script.Parent.BrickColor = BrickColor.new("Navy blue")
						ticks = 0
						else return
					end
					else return
	end
	end
function touchend(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		local char = hit.Parent
		local plar = game.Players:GetPlayerFromCharacter(char)
		ticks = ticks - 1
	end
end
	end 
	end
	script.Parent.TouchEnded:connect(touchend)
	script.Parent.Touched:connect(touch)

Help.

2 comments

1

Which line? It should output which line is causing the error.

0

Now that you edited your title... Are you getting an error or not?