Quote:
|
Originally Posted by jake13jake
PHP Code:
Simplest Example:
function onWeaponFired() {
this.orangeboogaloo = "hahahhaha";
player.chat = makevar("this.orangeboogaloo");
}
|
>_> That's not a good use of makevar.
Let's say an NPC logs how many times a player enters a level.
When the player says '/showtimes,' it tells them how many times they've been in.
PHP Code:
function onPlayerEnters() {
makevar("this.timesentered_" @ player.account)++;
}
function onPlayerChats() {
if (player.chat == "/showtimes") player.chat = makevar("this.timesentered_" @ player.account);
}
When a player enters the level, it adds 1 to 'this.timesentered_<their account>'
So when I enter, it increases this.timesentered_Yen by 1.