munro Posted July 27, 2008 Author Share Posted July 27, 2008 ok this is annoying me, I've been working on scripts for hours and cant get this one to work…well its not that its a cant add to it. what i need to do is add a value to a variable without resetting the variable.I've tried different lines of put and get var but none work. can someone help Link to comment Share on other sites More sharing options...
dg1423 Posted July 27, 2008 Share Posted July 27, 2008 var = int(var) + 1? Link to comment Share on other sites More sharing options...
munro Posted July 27, 2008 Author Share Posted July 27, 2008 sorry but that would work how with this statement?Call SetPlayerHP(index, GetPlayerHP(index) + 5) call SOMETHINGvar("\Scripts\skill\" & GetPlayerName(index) &".ini", "Prayer", "XP", SOMETHING)something would be…well what i have no idea what to add Link to comment Share on other sites More sharing options...
dg1423 Posted July 27, 2008 Share Posted July 27, 2008 well you'd use a getvar, store it in a variable. and use either var = int(var) + 1 then a putvar with var, or just have a putvar with (int(var) + 1) in it. if you wanna explain what you want the script to do, and post what you have, I'd be happy to help you. Link to comment Share on other sites More sharing options...
munro Posted July 27, 2008 Author Share Posted July 27, 2008 a scripted spell that heals 5 hp and adds 5 xp each time casted to that specific .ini file, i can do the rest. Link to comment Share on other sites More sharing options...
balliztik1 Posted July 27, 2008 Share Posted July 27, 2008 > Call PutVar("\Scripts\skill\" & GetPlayerName(index) &".ini", "Prayer", "XP", GetVar("\Scripts\skill\" & GetPlayerName(index) &".ini", "Prayer", "XP") + 5)You'll have to use GetVar to get the same value. It seems redundant, but it's how it has to be done. Alternatively, if you don't like the way this looks, you can do something like this:> Value = GetVar("\Scripts\skill\" & GetPlayerName(index) &".ini", "Prayer", "XP") + 5> Call PutVar("\Scripts\skill\" & GetPlayerName(index) &".ini", "Prayer", "XP", Value) Link to comment Share on other sites More sharing options...
munro Posted July 27, 2008 Author Share Posted July 27, 2008 i used the first one you wrote, a while ago but it didnt work. ill try againEDIT: ahahahaha i realized what i did wrong, i forgot call the first time i tried it lmao Link to comment Share on other sites More sharing options...
shrig94 Posted July 29, 2008 Share Posted July 29, 2008 lol, munro, you hadn't called it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now