naughtyniece Posted July 17, 2015 Share Posted July 17, 2015 Hi,I have a single prim/object and it has floating text "You have voted " + votes + " times". This works and displays "You have voted 0 times". I have code to increase 'votes' using votes == votes+1. How do i get the variable 'votes' to be stored? Because when i declare it as integer it resets it to 0?thank you Suzie Link to comment Share on other sites More sharing options...
Dora Gustafson Posted July 17, 2015 Share Posted July 17, 2015 Make 'votes' a global variable and it will be remembered until the script is reset or recompiled :smileysurprised::smileyvery-happy: Link to comment Share on other sites More sharing options...
naughtyniece Posted July 17, 2015 Author Share Posted July 17, 2015 How do i do that please? Link to comment Share on other sites More sharing options...
naughtyniece Posted July 17, 2015 Author Share Posted July 17, 2015 This does not work, it just sets to 1 and then stays that way? integer votes; default { touch_start(integer total_number) { votes == votes +1; llSetText( "Votes cast: " + (string)votes, <1.0, 0.4, 0.0>, 1.0); } Link to comment Share on other sites More sharing options...
Dora Gustafson Posted July 17, 2015 Share Posted July 17, 2015 if you write: votes = votes +1: or votes += 1; it will work :smileysurprised::smileyvery-happy: 1 Link to comment Share on other sites More sharing options...
naughtyniece Posted July 17, 2015 Author Share Posted July 17, 2015 Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now