ID:262061
 
obj/magic
ThunderShield
name = "Thunder Shield On/Off."
Click()
var/obj/TS1 = new/obj/thundershield/one(locate(usr.x-1,usr.y+1,usr.z))
var/obj/TS2 = new/obj/thundershield/two(locate(usr.x,usr.y+1,usr.z))
var/obj/TS3 = new/obj/thundershield/three(locate(usr.x+1,usr.y+1,usr.z))
var/obj/TS4 = new/obj/thundershield/four(locate(usr.x-1,usr.y,usr.z))
var/obj/TS5 = new/obj/thundershield/five(usr.loc)
var/obj/TS6 = new/obj/thundershield/six(locate(usr.x+1,usr.y,usr.z))
var/obj/TS7 = new/obj/thundershield/seven(locate(usr.x-1,usr.y-1,usr.z))
var/obj/TS8 = new/obj/thundershield/eight(locate(usr.x,usr.y-1,usr.z))
var/obj/TS9 = new/obj/thundershield/nine(locate(usr.x+1,usr.y-1,usr.z))
usr << "<B>You put on your Thunder Shield."
on = 1
sleep(30)
del(TS1)
del(TS2)
del(TS3)
del(TS4)
del(TS5)
del(TS6)
del(TS7)
del(TS8)
del(TS9)
on = 0
usr << "<B>Your Thunder Shield wears off.</B>"


I want it to run out after a few seconds(works), and I want an option to turn it off manually when you press it again

Is there anyway on how to do that?(Give examples, Im not english), Thank you very Much!
Yes, there are ways. Also, there are easier ways to do what you did there which you will probably like.
mob
var/stop_shield=1
proc/Dismiss_ThunderShield()
stop_shield=0
obj/magic
ThunderShield
name = "Thunder Shield On/Off."
Click()
var/obj/TS1 = new/obj/thundershield/one(locate(usr.x-1,usr.y+1,usr.z))
var/obj/TS2 = new/obj/thundershield/two(locate(usr.x,usr.y+1,usr.z))
var/obj/TS3 = new/obj/thundershield/three(locate(usr.x+1,usr.y+1,usr.z))
var/obj/TS4 = new/obj/thundershield/four(locate(usr.x-1,usr.y,usr.z))
var/obj/TS5 = new/obj/thundershield/five(usr.loc)
var/obj/TS6 = new/obj/thundershield/six(locate(usr.x+1,usr.y,usr.z))
var/obj/TS7 = new/obj/thundershield/seven(locate(usr.x-1,usr.y-1,usr.z))
var/obj/TS8 = new/obj/thundershield/eight(locate(usr.x,usr.y-1,usr.z))
var/obj/TS9 = new/obj/thundershield/nine(locate(usr.x+1,usr.y-1,usr.z))
usr << "<B>You put on your Thunder Shield.</b>"
on = 1
var/index=1
usr.verbs+=/mob/proc/Dismiss_ThunderShield
while(index<=30&&!usr.stop_shield)
sleep(1)
index+=1
verbs-=/mob/verb/Dismiss_ThunderShield
del(TS1)
del(TS2)
del(TS3)
del(TS4)
del(TS5)
del(TS6)
del(TS7)
del(TS8)
del(TS9)
on = 0
usr << "<B>Your Thunder Shield wears off.</B>"