ID:156797
 
How would I get this done? Currently I have

requiredskills = /Skills/Skill1Icon&&/Skills/Skill2Icon


the variable "requiredskills" is currently just a normal variable. It was just a list a while ago but I couldn't get this to work out.

I use
if(locate(src.requiredskills) in usr.Skills)


to look through my skills to find out if I have the required skills to buy the next skill. This doesn't seem to be working. Any ideas?
You need to use a list, and loop through that list looking for each of the required skills.
In response to Garthor (#1)
Garthor wrote:
You need to use a list, and loop through that list looking for each of the required skills.

I've tried that but still no results :/.

                        for(var/Skills/I in src.requiredskills)
if(I in usr.Skills)


requiredskills = list(/Skills/Skill1,/Skills/Skill2)
In response to AbdelJN (#2)
In response to Garthor (#3)
?
In response to AbdelJN (#4)
If you cant get the loop to work you could try adding variable..
mob/var/requiredskills=0


Then when you learn the first skill

usr.requiredskills += 1

then when you learn the other skill

usr.requiredskills += 1 yet again

skill3
if(usr.requiredskills == 2)
Give me skill3!!


just an idea, you would need to save the var though
In response to AbdelJN (#2)
Wouldn't it make sense to search for skills that the user does NOT have, and if that condition is true (if(!(X in Y))), say a message than have a return).

Another problem MAY be that you have requiredskills as paths. This is not a problem is X.Skills contains just paths as well... but if it doesn't, you need to make requiredskills contain the new instances for those paths, or loop through X.Skills and see if it's path (X.Skills.type) is not in the entry (see first paragraph).
In response to Tonyth (#5)
Jegus, no. All he needs to do is combine what he has in his most recent post with what he has in his first post.