ID:266171
 
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?
SSJ4_Link wrote:
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?

Got me stumped.

Myself I'd probably experiment with having a variable that indicates whether the shield magic is on, and check that when you try to use it.

But since surely you already thought of that, I have no idea what else to try.
SSJ4_Link wrote:
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?

heres how it goes

make a var such as this

mob/var/shield_m = 0

then when you user the shaield magic first make it check, do something like this(make sure you replace (tabs) with a tab and change the code to make it fit in with rest of code):

if(usr.shield_m == 0)
(tab)ShieldM()
else
(tab)usr << "You already have a shield on!"

Now the main difference is the ShieldM() now to make it work do this:

mob/proc/ShieldM()
(tab)usr.shield_m = 1
(tab)//stuff for magic shield goes here (such as usr.defense + 50)
(tab)sleep(10) //change the ten to however long it will be before it wears off
(tab)//remove effects of shield such as usr.defense - 50
(tab)usr.magic_s = 0

Let me know if ya got any problems
In response to Geo
Geo wrote:
SSJ4_Link wrote:
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?

heres how it goes

make a var such as this

mob/var/shield_m = 0

then when you user the shaield magic first make it check, do something like this(make sure you replace (tabs) with a tab and change the code to make it fit in with rest of code):

if(usr.shield_m == 0)
(tab)ShieldM()
else
(tab)usr << "You already have a shield on!"

thanks that was a big help
Now the main difference is the ShieldM() now to make it work do this:

mob/proc/ShieldM()
(tab)usr.shield_m = 1
(tab)//stuff for magic shield goes here (such as usr.defense + 50)
(tab)sleep(10) //change the ten to however long it will be before it wears off
(tab)//remove effects of shield such as usr.defense - 50
(tab)usr.magic_s = 0

Let me know if ya got any problems
In response to SSJ4_Link
SSJ4_Link wrote:
Geo wrote:
SSJ4_Link wrote:
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?

heres how it goes

make a var such as this

mob/var/shield_m = 0

then when you user the shaield magic first make it check, do something like this(make sure you replace (tabs) with a tab and change the code to make it fit in with rest of code):

if(usr.shield_m == 0)
(tab)ShieldM()
else
(tab)usr << "You already have a shield on!"

thanks that was a big help
Now the main difference is the ShieldM() now to make it work do this:

mob/proc/ShieldM()
(tab)usr.shield_m = 1
(tab)//stuff for magic shield goes here (such as usr.defense + 50)
(tab)sleep(10) //change the ten to however long it will be before it wears off
(tab)//remove effects of shield such as usr.defense - 50
(tab)usr.magic_s = 0

Let me know if ya got any problems

now i have a problem on the verb i did shield_m+=1 how can i keep it from going over 1
In response to SSJ4_Link
SSJ4_Link wrote:
SSJ4_Link wrote:
Geo wrote:
SSJ4_Link wrote:
how would i make it if u have a shield magic on and u try and use it again it says "Its already on."?

heres how it goes

make a var such as this

mob/var/shield_m = 0

then when you user the shaield magic first make it check, do something like this(make sure you replace (tabs) with a tab and change the code to make it fit in with rest of code):

if(usr.shield_m == 0)
(tab)ShieldM()
else
(tab)usr << "You already have a shield on!"

thanks that was a big help
Now the main difference is the ShieldM() now to make it work do this:

mob/proc/ShieldM()
(tab)usr.shield_m = 1
(tab)//stuff for magic shield goes here (such as usr.defense + 50)
(tab)sleep(10) //change the ten to however long it will be before it wears off
(tab)//remove effects of shield such as usr.defense - 50
(tab)usr.magic_s = 0

Let me know if ya got any problems

now i have a problem on the verb i did shield_m+=1 how can i keep it from going over 1

er, oops hehe. change it to shield_m = 1. also it should already because of the if(shield_m == 0) so people cant use it unless activated.