![]() |
Plz Help Again...
Im making sand mining for my server (cuz sand is rare) and i don't know how to make it random.. so u don't get the same ammount of sand every time... can anyone help??
SCROLL DOWN .. i need more help ~edited later after i got help~ |
That's incredibly easy. You can do it in a number of ways but I'll show you mine:
NPC Code: |
Thanks for the help
Scroll down |
~~if someone buys 100 sand from me it does this~~
this.sandplus=strtofloat(#s(sandammt))+100; setstring sandammt,#v(this.sandplus); ~~This is the sand jar...~~ if (weaponfired) { say2 Your Sand: #s(sandammt); } ~~This is the (unnamed) mining tool~~ if (weaponfired){ set action.miningsand; setcharprop #c, You have #v(this.number) Sand; } ~~This is in the Mining Place...~~ if (action.miningsand) { this.number=random(1,10); setstring sandplus,#v(this.number); } It doesn't work.. the sand just goes from 2.9382 or sumthin like that to 1.38473 then back to 29382 and to 1.38473.. can anyone help ? |
say
this.number=int(random(1,11)); I just included int to it so it gets the integer of it. I added 1 to the last number because it can never be what the last number says... So this way it gives it a chance to be anywere from 1-10 insted of 1-9 (how it usto be) |
flags are not cool:cool: :cool: :cool: :cool: :cool:
|
| All times are GMT +2. The time now is 12:31 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.