like this?:
        Attack()
usr.freeze = 1
flick("Attack",src)
for(var/mob/character/m in get_step(src, dir))
world << m
var/Damage=max(0,src.Str-m.Def)
m.KnockBack(10)
view(m)<<"[src] hit [m] for [Damage] Damage!"
m.Deathcheck()
usr.freeze=0
sleep(50)
No the sleep above the usr.freeze=0
oh before, k
        Attack()
usr.freeze = 1
flick("Attack",src)
for(var/mob/character/m in get_step(src, dir))
world << m
var/Damage=max(0,src.Str-m.Def)
m.KnockBack(10)
view(m)<<"[src] hit [m] for [Damage] Damage!"
m.Deathcheck()
sleep(50)
usr.freeze=0
...still moves...... Im confuzled...
I prefer to do it with a time value...

With a time value, you set a variable to the next time they're allowed to use / do something, and then you just check current time against that value...


mob/var/tmp/can_move_time = 0

Move()
if(world.time < can_move_time) return 0 //its not time to move again, yet
. = ..()
if(.)
can_move_time = world.time + 3 //you're allowed to move in 3 tenths of a second


So in your example, you can do it like this

Attack()
usr.can_move_time = world.time + 10 // in a second, we can move again
flick("Attack", src)
...
...

Move()
if(world.time < src.can_move_time) return 0
. = ..()
if(.)
src.can_move_time = world.time + 3
I'd take FIREking's suggestion. It is the best approach that I'm aware of. Plus, it is very flexible.

Just a few edits of mine
mob
var
tmp/freeze_time = 0
proc
frozen()
return world.time < freeze_time

freeze(ticks)
freeze_time = max(freeze_time,world.time+ticks)

Move()
if(frozen())
return 0
. = ..()
if(.)
freeze(3)

verb // or perhaps proc
Attack()
freeze(10)
// stuff
Fire king ur way doesnt use sleep does it? cause i tried doing it but i can still move while attacking....
In response to Panda dude XD
Panda dude XD wrote:
Fire king ur way doesnt use sleep does it? cause i tried doing it but i can still move while attacking....

you need to make sure that you're putting the freeze check logic in the last version of Move()

DM grabs code files alphabetically. If you define move in the last alphabetical file, and it overrides a previous definition, the previous definition is ignored.
about to quit.....jemails way doesnt work either...i wonder if its because i forgot to mention that my characters are defined with a class system so all my attack verbs and stuff branch off from mob/character. but even when i change the code u guys give me from "mob" to "mob/character" i just get an error anyway :/
In response to Panda dude XD
Panda dude XD wrote:
about to quit.....jemails way doesnt work either...i wonder if its because i forgot to mention that my characters are defined with a class system so all my attack verbs and stuff branch off from mob/character. but even when i change the code u guys give me from "mob" to "mob/character" i just get an error anyway :/

You need to verify these things are happening... try this

mob/character/var/tmp/move_time = 0
mob/character/verb/Attack()
world << "I was called!"
move_time = world.time + 1000

mob/character/Move()
if(world.time < move_time)
world << "You can't move right now!"
return 0
. = ..()
if(.)
move_time = world.time + 2


Run that code, verify that it actually out puts text and is working.
Defining those on /mob/player should work fine. We were just using /mob as placeholder since we didn't know the specific mob you are dealing with until this very moment.
In response to FIREking
nope, i dont get the text when i use Attack()>_<
In response to Panda dude XD
Panda dude XD wrote:
nope, i dont get the text when i use Attack()>_<

then you are defining attack twice, and none of this code is working because you're never setting the move_time variable.
Then change character to whatever the player is assigned as, this may be player ? we don't know perhaps look at world/mob and see what that has been set as.

The fact that you don't know your own code makes me suspect you are using a source, if you are that's bad and you will pick up bad programming styles.
Then you've got another Attack verb somewhere and it is the one being called instead.
In response to A.T.H.K
what'd u mean by using a source? as far as i know the move proc is defined in sidescroller and i cant find it for some reason. and with attack its defined under each character i have but no where else. for example:
mob/deidara
icon = 'Deidara.dmi'
verb

Attack()
flick("Attack",src)
for(var/mob/character/m in get_step(src, dir))
world << m
var/Damage=max(0,src.Str-m.Def)
m.KnockBack(10)
view(m)<<"[src] hit [m] for [Damage] Damage!"
m.Deathcheck()


and

        Attack()
flick("Attack",src)
for(var/mob/character/m in get_step(src, dir))
world << m
var/Damage=max(0,src.Str-m.Def)
view(m)<<"[src] hit [m] for [Damage] Damage!"
m.Deathcheck()


...and now that im thinking about it i didnt make a move_time variable myself if thats what u mean, i used your example. (@fireking)

oh oops the 2nd attack verb is defined under
mob/erza
icon = 'Erza.dmi'
verb
Attack()
flick("Attack",src)
for(var/mob/character/m in get_step(src, dir))
world << m
var/Damage=max(0,src.Str-m.Def)
view(m)<<"[src] hit [m] for [Damage] Damage!"
m.Deathcheck()
OH LOL JK I GOT THE TEXT TO WORK XD OOPS
K i think i can do this on my own now...
after hours of struggling, i've decided my players will move and attack at the same time ._.
Page: 1 2 3