[web version] How does status attributes work?

I tried to follow the tutorial but it didnt seem to work, here is the code that i typed in. I put this code in the start script as the tutorial told me to do.

set (you, "statusattributes", 0) set (you, "statusattributes", NewStringDictionary()) dictionary add (you.statusattributes, "score", "Score: !/10")

also, additional question, how do i increase the score?


Could you post the link of the tutorial page where you found this code?


I assume that is meant to be:

set (you, "statusattributes", 0)
set (you, "statusattributes", NewStringDictionary())
dictionary add (you.statusattributes, "score", "Score: !/10")

with some line-breaks in.

I don't think this came from a good tutorial, as the first line is completely useless. The same thing could be written more simply as:

you.statusattributes = NewStringDictionary()
dictionary add (you.statusattributes, "score", "Score: !/10")

I also assume that you is the name of the player object.
Using the name of the player in code is a bad habit to get into. It would be better to use game.pov (which refers to the player object regardless of its name).


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums