ID:139263
 
Code:
turf
Rock
icon = 'icons.dmi'
icon_state = "Rock_Symbol"
Click()
if(SkillPoints==200) usr << "You can now buy Rock Jutsus"
else usr << "Not enough Skill Points"
mob/var
SkillPoints = 300


Problem description:
Its saying Undefined Var, when I defined it. O.o

The way you wrote it, it is assuming "src.SkillPoints" - however, the src, when you use Click(), is the object you are clicking. Therefore, to fix this issue:

Click()
if(usr.SkillPoints==200) {usr << "You can now buy Rock Jutsus"; }
else {usr << "Not enough Skill Points!";}


However, looking at this, if someone is buying something, it's rare they will have the EXACT compensation (SkillPoints in this case) - I don't know how your game functions, but 99 times out of 100, you should use if(usr.SkillPoints>=200). Just something I noticed.
In response to Nal_rA
Thank you xD
It was a rough copy, and I was worried about fixing the var that I forgot to add that
In response to Atriosv3
BUMP!!!!
In response to Atriosv3
I'm confused, you still have an issue? And you bumped this whilst it was still on the front page? Is there a separate issue?
In response to Nal_rA
Still pops up :|
In response to Atriosv3
Bump
In response to Atriosv3
Your Code:
turf
Rock
icon = 'icons.dmi'
icon_state = "Rock_Symbol"
Click()
if(SkillPoints==200) usr << "You can now buy Rock Jutsus"
else usr << "Not enough Skill Points"
mob/var
SkillPoints = 300


Alright, it's giving you the Undefined Var error because the SkillPoints var you defined for mobs doesn't work for turfs. Only other mobs! Sure you may have already known that but, maybe you didn't know that The Click() is thinking the SkillPoints var is a var for turfs and doesn't see it in the... Uh, Var Database? But anyways, you need to make it so that the Click() realizes that you're talking about the skillpoints of the guy who clicked it, not the SkillPoints of the Rock, it doesn't have any! And it shouldn't...

To fix your issue, you'd change
if(SkillPoints==200) usr << "You can now buy Rock Jutsus"

To
if(usr.SkillPoints==200) usr << "You can now buy Rock Jutsus"


I hope I have helped!
In response to Kenny84
I already fixed it Ghtry helped me but thank you aswell ^_^
In response to Atriosv3
why did you keep bumping it then?
In response to Saladon
Yeah, I thought it wasn't solved :P

Next time, you should add [SOLVED] in front of the Topic Title in the First Post to avoid confusion.