ID:262054
 
obj/magic
ThunderShield
name = "Thunder Shield On/Off."
Click()
if(!on)
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)
if(on)
del(TS1)
del(TS2)
del(TS3)
del(TS4)
del(TS5)
del(TS6)
del(TS7)
del(TS8)
del(TS9)
on = 0
usr << "<B>You turn off your Thunder Shield."
if(usr.logout == 1)
del(TS1)
del(TS2)
del(TS3)
del(TS4)
del(TS5)
del(TS6)
del(TS7)
del(TS8)
del(TS9)
usr.logout = 0


Mana Skills.dm:128:error:TS1:undefined var
Mana Skills.dm:129:error:TS2:undefined var
Mana Skills.dm:130:error:TS3:undefined var
Mana Skills.dm:131:error:TS4:undefined var
Mana Skills.dm:132:error:TS5:undefined var
Mana Skills.dm:133:error:TS6:undefined var
Mana Skills.dm:134:error:TS7:undefined var
Mana Skills.dm:135:error:TS8:undefined var
Mana Skills.dm:136:error:TS9:undefined var
Mana Skills.dm:140:error:TS1:undefined var
Mana Skills.dm:141:error:TS2:undefined var
Mana Skills.dm:142:error:TS3:undefined var
Mana Skills.dm:143:error:TS4:undefined var
Mana Skills.dm:144:error:TS5:undefined var
Mana Skills.dm:145:error:TS6:undefined var
Mana Skills.dm:146:error:TS7:undefined var
Mana Skills.dm:147:error:TS8:undefined var
Mana Skills.dm:148:error:TS9:undefined var

I know why this is, but is there a way to make an on/off trigger with an auto deleting system within a time period or when the player logs out?
You are defining a var in an if, then calling another expecting it to still be there.
In response to Scoobert
i KNOW the prob, but is there a way to actually MAKE a trigger
In response to SSJ4 Compufreak
*bump*
In response to SSJ4 Compufreak
The easiest way that I can think of is make the thundershield stuff in a var on src. That way it can be added and removed with a static var. Seems simple enough to me.
In response to Scoobert
already tried that -_-, it cant make an object on an earlier made var
In response to SSJ4 Compufreak
*bump*
In response to SSJ4 Compufreak
SSJ4 Compufreak wrote:
already tried that -_-, it cant make an object on an earlier made var

No idea what that's supposed to mean, but it looks to me like you have issues understanding variable scope. If you can elaborate it'd help.

Lummox JR