Error in my comment

So I was making a for loop, and it kept breaking but I didn’t know why. Here’s a funny thing that happened when I commented it out:

--bigcrazycarboy
local Event = game.ReplicatedStorage:FindFirstChild("GunSwapEvent", true)

function DropGun(Tool)
	
end

hi = false
local UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(function(input)
	if input.KeyCode == Enum.KeyCode.V  and hi == false then
		--hi = true
		--[[for _,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
			print("Began for loop.")
			warn(game.Players.LocalPlayer.Character.Name)
			print(v.Name)
			if --[[v:isA("Tool")]] v.ClassName == "Tool" then
				warn("Found a tool")
				--v:Destroy()
				Event:FireServer("Drop", v)
				--DropGun(v)
				warn("Fried the server to drop")
			end
			wait()
			--script.Box.Value.Gun.Value:Clone().Parent = game.Players.LocalPlayer.Character	
		end	]]
		print("done w loop")	
		Event:FireServer("PickUp", script.Box.Value)
		--script.Box.Value:Remove()	
		warn("Fried the Server")
	end
end)

This is a case of incorrect syntax highlighting (and it seems the forums also have it)
You have “]]” inside the comment, which ends the comment, even though it’s supposed to close another comment that exists inside the comment. You’re using nested brackets. You can start the comment with --[=[ and end it with ]=] to have nested block comments, with different numbers of ='s like --[===[ ]===]

Ah, you got it. I didn’t know --[=[ existed but I think I’m gonna start using it now :joy: You can lock this one @Lilly_S

1 Like