ID:2099433
 
(See the best response by GreatPirateEra.)

Code:
            if(throwing==1)
usr.overlays -= /obj/Dodgeball
flick("attack",src)
var/O = new/obj/Dodgeball(usr.loc)
walk(O,usr.dir)
throwing=0
usr.Freeze=0
usr.overlays -= /obj/Bar
usr.icon_state = "walk"
equipped=0


Problem description:I get this message every time I attempt throw the ball the ball stays still and this message spams in the chat.

src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
usr: 0
src: Dodgeball (/obj/Dodgeball)
src.loc: Floor2 (22,16,1) (/turf/Floor2)
call stack:
Dodgeball (/obj/Dodgeball): Move(Floor2 (22,16,1) (/turf/Floor2), 2, 0, -8)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
runtime error: Cannot read 0.Freeze
proc name: Move (/atom/movable/Move)
runtime error: Cannot read 0.Freeze
usr is null, try using src
Best response
This is the problem
var/O = new/obj/Dodgeball(usr.loc)

You can't typecast like that. You need to do
var/obj/Dodgeball/O = new(usr.loc)

EDIT: Also, stop mixing usr and src.
I tried to do as you suggested @GreatPirateEra, but I got the same problem
In response to GreatPirateEra
You can typecast like that, its just not preferable because var access with the . operator will compile as an error on specific variables. The obvious way to bypass that is to use the : operator to access it instead, but it's bad practice because it stops the compiler from helping you verify things.
You should use src instead of usr, usr doesn't always have the value you think it does. src is assumed when no object is specified, and no local or global matches exist.

src.Freeze = 0 or just Freeze = 0

So:

            if(throwing==1)
overlays -= /obj/Dodgeball
flick("attack", src)
var/obj/Dodgeball/O = new(usr.loc)
walk(O, dir)
throwing=0
Freeze=0
overlays -= /obj/Bar
icon_state = "walk"
equipped=0
I would be remiss not to point out that if(throwing==1) is the wrong way to check a true/false value. That should be if(throwing) instead; for values that are only true or false, you never want to rely on specific values for them. Likewise, any check for if(throwing==0) should be if(!throwing).

Also I would be remiss not to point out that having an equipped var on an object is backwards. The mob should keep track of its equipment; the equipment should never try to keep track on its own of whether it's equipped or not. The reason is that the latter system is much too brittle, and will break if the object changes hands without updating its info properly. Robust code demands that the mob, and only the mob, should know if it has a given object equipped.
In response to Lummox JR
Agreed.