function Initialize(Plugin) Plugin:SetName("BlockPBProtection") Plugin:SetVersion(1) DebugMode = 0 Intensity = 1 BadBlocks = {7, 2} NumberofBadBlocks = 2 Server = cRoot:Get():GetServer() cPluginManager:Get():AddHook(Plugin, cPluginManager.HOOK_PLAYER_BROKEN_BLOCK); cPluginManager:Get():AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACING_BLOCK); LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) return true end function OnPlayerBrokenBlock(Player, BlockX, BlockY, BlockZ, BlockFace, BlockType, BlockMeta) PlayerName = Player:GetName() if DebugMode == 1 then Player:SendMessage("You broke BlockID: " .. BlockType) end for i = 1,NumberofBadBlocks, 1 do if BadBlocks[i] == BlockType then Server:SendMessage(PlayerName .. " has placed: " .. BlockType) LOG(PlayerName .. " has placed: " .. BlockType, 1) if Intensity == 1 then ClientHandle = Player:GetClientHandle() ClientHandle:Kick("You placed a bad block") elseif Intensity == 2 then --Your code here? end end end return false end function OnPlayerPlacingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType) PlayerName = Player:GetName() if DebugMode == 1 then Player:SendMessage("You placed BlockID: " .. BlockType) end for i = 1,NumberofBadBlocks, 1 do if BadBlocks[i] == BlockType then Server:SendMessage(PlayerName .. " has placed: " .. BlockType) LOG(PlayerName .. " has placed: " .. BlockType, 1) if Intensity == 1 then ClientHandle = Player:GetClientHandle() ClientHandle:Kick("You placed a bad block") elseif Intensity == 2 then --Your code here? end end end return false end