![]() |
Help on A Script
Ok this script is used to sell Lumber that you have. But when I say sell lumber it gives you your money, but if you say it again it takes money?!?! Can Someone heklp who understands String and var more than me?
// Created By Rob Getashu if (created) { // Initialize the attributes showcharacter; setcharprop #3,head0.gif; setcharprop #C0,orange; setcharprop #C1,white; setcharprop #C2,blue; setcharprop #C3,red; setcharprop #C4,black; setcharprop #2,shield1.gif; shieldpower = 1; dir = 2; } if (playerchats&&strequals(#c,sell lumber)) { lumber = strtofloat(#s(lumber)); playerrupees = lumber; setstring lumber,#v(lumber); lumber = strtofloat(#s(lumber))=0; setstring lumber,#v(lumber); setstring client.lumber,#s(lumber); setstring server.gavelumber,#v(strtofloat(#s(server.gavelumb er))=0); } |
well your problem is where is says playerruppes = lumber
that means say you have 10 lumber you say it you get 10g and no more lumber so you say it again when you have no lumber your gralat will = 0 because that was the lumber number try using playerrupees = playerrupees+lumber |
Ok thx let me try that
|
Ugh...or dont be so nasty about it and use playerrupees += lumber;
|
if (playerchats&&strequals(#c,sell lumber)) {
this.lumber = strtofloat(#s(client.lumber)); playerrupees+=this.lumber; setstring client.lumber,; setstring server.gavelumber,#v(this.lumber); setplayerprop #c,You sold #v(this.lumber) logs; } like that? (i added a setplayer .. u can take that out.. the other part wasnt needed .. u can take out the server.gavelumber. keep it if ur recording how much the last player sold last) |
| All times are GMT +2. The time now is 06:09 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.