Code:
function ChopChop(iPlayer, iUnit, iX, iY, iBuild)
local pPlayer = Players[iPlayer]
local pUnit = pPlayer:GetUnitByID(iUnit)
for pUnit in pPlayer:Units() do
if pUnit:GetUnitClassType() == GameInfoTypes.UNITCLASS_WORKER then
print("Choppy chop?")
if (iBuild == GameInfoTypes.BUILD_REMOVE_FOREST) then
print("No chop?")
return false
end
end
end
return true
end
GameEvents.PlayerCanBuild.Add(ChopChop)

I couldn't figure out why it was doing this at all, was it because the GameEvents.PlayerCanBuild.Add() didn't exist? It couldn't because I was able to add in nonexistent functions with no errors, so I copied the same code and just gave it a rename.

Could anyone help shed some light on this issue if they had it before?
Problem resolved: Newest version of Community Patch seems to be causing errors.