The Var
obj/var/tmp
lash = 0
The code
mob/verb
LashingWhip()
set category = null
if(safe) return
if(se < 100)
src << "<b>Your Energy is to low wait for it to recover!"
return
if(!firing)
view(8) << "<b>[src]: Lashing Whip"
firing = 1
src.contents += new/obj/whip
New()
Whip1()
The Proc
obj
proc/Whip1()
if(lash) //infinite ticker loop
src << "You have called your Lashing Whip."
lash = 1
src.contents -= new/obj/whip
sleep(5)
Problem description:
What I wanna do is make the whip vanish after so many seconds in this case 5 but it just stays in the inventory no vanishing at all it just stays there
[EDIT] if(lash) means that if lash is true or equal to one. You are trying to check if it isn't true I guess. If yes, use if(!lash).
First of all, your proc code makes no sense. You are calling sleep after the item has been removed from the inventory. Use sleep before an event.
Next, sleep(5) wont make it wait for 5 seconds, you need to use sleep(50) to make it wait for 5 seconds, since its in 1/10th seconds.
Lastly, you cannot remove the item from an inventory the same way you are adding it. src.contents -= new/obj/whip makes no sense, you are creating a new obj with the path /obj/whip and then trying to removing it from src inventory.
Use locate() to first find a certain obj inside a container then if it exists, remove it.