ID:147372
 
I posted this problem about 2 days ago but i wasnt explaining my problem well so ill try again.In the code at the bottom of the post im using for. The problem im having with for is that im getting too many error messages and K inputs.For example
if(usr.Pet)
usr << "[BadMessage]You already have a pet Out"
It would give me that error message once for every Pet it found and here var/K = input("Which slot do you want to Revive?","[usr.Pet]")in list("Slot One","Slot Two","Slot Three","Slot Four","Cancel") it would give me the choice to Revive once for every pet it found.I would like to know what i should do.I Hope i explained my problem well enough so you can understand it.
if("Revive")
for(var/mob/Pets/T in usr)
if(T)
if(usr.Pet)
usr << "[BadMessage]You already have a pet Out"
else
var/K = input("Which slot do you want to Revive?","[usr.Pet]")in list("Slot One","Slot Two","Slot Three","Slot Four","Cancel")
switch(K)
if("Slot One")
if(T.PetSlot == 1)
You're looping through all of the pets the player has. Why? There doesn't seem to be any point in it. Get rid of the loop and the if(T) line.
In response to Crispy
Im Checking for every pet in his inventory because in my storing system. When i store a pet it go's into the players inventory and he can have a max of 4 Stored Pets.Now when i revive i want it to Loop through his inventory to check for any pets that he stored because later on you can see that i check if any of the T(The var i used with for) has a PetSlot1(Only PetSlot1 if he chooses Slot1 btw) var equal to 1.