CarnivalOfFear Posted June 15, 2012 Share Posted June 15, 2012 Question: How do you use operators such as + - / and * in a scriptIm trying to make a simple counter that works once the player has completed a certain number of tasks I simply need to increase and int value by one every time a scripted action is done by the player. I cant find syntax examples anywhere. Link to comment Share on other sites More sharing options...
Cyberlazy Posted June 15, 2012 Share Posted June 15, 2012 int xset x to 1set x to x * 2set x to x + 1 etc. Link to comment Share on other sites More sharing options...
moburma80 Posted June 15, 2012 Share Posted June 15, 2012 int iCount ; This is our counter variable we want to increase Begin Gamemode ;or Onload or whatever makes sense for what you're trying to do if Whatever ;whatever conditions trigger the event being done set iCount to iCount +1 endif end You'll probably also want some kind of variable to make sure the script only runs once only so the counter doesn't constantly go up (e.g. a bDoOnce or whatever). Link to comment Share on other sites More sharing options...
CarnivalOfFear Posted June 15, 2012 Author Share Posted June 15, 2012 int iCount ; This is our counter variable we want to increase Begin Gamemode ;or Onload or whatever makes sense for what you're trying to do if Whatever ;whatever conditions trigger the event being done set iCount to iCount +1 endif end You'll probably also want some kind of variable to make sure the script only runs once only so the counter doesn't constantly go up (e.g. a bDoOnce or whatever). figured that out. the only thing I was missing was the second x name after the to in set x to x + 1 Link to comment Share on other sites More sharing options...
Recommended Posts