ID:168960
 
        verb
Carpentry(var/obj/items/log/O)
set category = "Skills"
var/K = rand(1,10)
if(!usr.canmakelumber)
if(locate(O) in usr)
if(K == 1 || 2 || 3 || 4 || 5)
new /obj/items/board(usr)
new /obj/items/woodchips(usr)
usr << "You have successfully made a board!"
del O
else
usr << "You fail to make a board and your log is lost."
del O
else
usr << "You don't have a log!"
else
usr << "You don't know the recipe to make a board!"

The problem is that I can use Carpentry on ANY obj. I want it so that it only looks works on ONE log and one log only when used, if the checks go through.
        verb
Carpentry(var/obj/items/log/O)
set category = "Skills"
var/K = rand(1,10)
if(!usr.canmakelumber)
for(O in usr)
if(K == 1 || 2 || 3 || 4 || 5)
new /obj/items/board(usr)
new /obj/items/woodchips(usr)
usr << "You have successfully made a board!"
del O
return
In response to Hiddeknight
Hiddeknight wrote:
>         verb
> Carpentry(var/obj/items/log/O)
> set category = "Skills"
> var/K = rand(1,2)
> if(!usr.canmakelumber)
> for(O in usr)
> if(K == 1)
> new /obj/items/board(usr)
> new /obj/items/woodchips(usr)
> usr << "You have successfully made a board!"
> del O
> return
>


Why not just...
In response to Strawgate
Because I don't know how to use the prob() or pick() procs, and I'm trying to have it where it's more likely that a board is made.

    verbbox
verb
Carpentry()
set category = "Skills"
var/obj/materials/log/O
if(usr.canmakelumber==1)
for(O in usr.contents)
if(O)
new /obj/items/board(usr)
new /obj/items/woodchips(usr)
usr << "You have successfully made a board!"
del O
return
else
usr << "This is not a log."
else
usr << "You don't know the recipe to make a board!"


I did it this way, and now I can use the Carpentry verb on any obj and rather than destroying the obj this time, it looks for a log in the usr's inventory and destroys it and makes the board.
The only thing I'm looking for now is either to prevent the Carpentry verb from being shown on the list of things to do to objs, or prevent it from doing the problem stated above.
[edit]
I have solved the problem. Fixed code is above.