ID:143003
 
Code:
mob/Hatake
verb
CopyJutsu(mob/M in oview(10))
set category = "Doujutsu"
set name = "Copy Jutsu"
if(usr.firing)
return
if(usr.froze)
usr<<"Your frozen"
return
if(usr.resting)
usr<<"Not while resting"
return
if(usr.caught)
usr<<"Your captured"
return
if(usr.meditating)
usr<<"Not while meditating"
return
if(usr.Frozen)
usr<<"Your frozen"
return
if(usr.captured)
usr<<"Your captured"
return
if(usr.resting)
usr<<"Not while resting"
return
if(usr.meditating)
usr<<"Not while meditating"
return
else // If the firing var isn't 1...
M<<"[usr] Copied Your Jutsu.."
usr<<"You Copied [M] Jutsu"
var/Sleeptime = round(usr.gen/10)
if(Sleeptime <= 1)
Sleeptime = 55
usr.verbs += M.verbs




Problem description:

i need help with a peice of coding so that when u click copy jutsu u copy the mobs jutsu that they just used

I think it is strange that some coders have noticeably worse grammar in forum posts than in the code. Can't imagine why, it's not like they took the code from another game or anything.

It would help to say what the problem is, instead of only stating what it should do. Coders aren't always patient enough to read through your code and find all the errors in them.

Here's an error I found. In the end, you have all the verbs M has. Or, you would, if the "verbs" variable worked that way. If you knew how to code, you'd be able to figure it out.
In that case, you are going to need to do a bit more coding.

First, you will need to set a variable (probably on the mob) which stores the last attack used. Then, you will need to have each attack change that variable when they are used.

Something like:


mob
player
var
storemove = ""

mob
player
verb
Stupid_Jutsu()
\\various if/else checks here
usr.storemove = "Stupid_Jutsu"


Of course, this is just a rough idea of the basics on how I would do it. I am a newbie, and this could be wrong.