Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-20-2001, 07:35 PM
KrAnKyP2P KrAnKyP2P is offline
Registered User
Join Date: Sep 2001
Location: I CoMe FrOm A LaNd FaR FaR AwAy
Posts: 330
KrAnKyP2P is on a distinguished road
Send a message via AIM to KrAnKyP2P
Question 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~
__________________

Last edited by KrAnKyP2P; 09-20-2001 at 09:43 PM..
Reply With Quote
  #2  
Old 09-20-2001, 08:51 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
That's incredibly easy. You can do it in a number of ways but I'll show you mine:
NPC Code:

if (actionWHATEVER) {
this.number=random(1,10);
setstring sandplus,#v(this.number);
}

__________________

-=Shard IceFire=-
Reply With Quote
  #3  
Old 09-20-2001, 09:25 PM
KrAnKyP2P KrAnKyP2P is offline
Registered User
Join Date: Sep 2001
Location: I CoMe FrOm A LaNd FaR FaR AwAy
Posts: 330
KrAnKyP2P is on a distinguished road
Send a message via AIM to KrAnKyP2P
Thanks for the help
Scroll down
__________________

Last edited by KrAnKyP2P; 09-20-2001 at 09:44 PM..
Reply With Quote
  #4  
Old 09-20-2001, 09:48 PM
KrAnKyP2P KrAnKyP2P is offline
Registered User
Join Date: Sep 2001
Location: I CoMe FrOm A LaNd FaR FaR AwAy
Posts: 330
KrAnKyP2P is on a distinguished road
Send a message via AIM to KrAnKyP2P
~~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 ?
__________________
Reply With Quote
  #5  
Old 09-21-2001, 02:48 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
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)
__________________
Thanks,
-KJL
Reply With Quote
  #6  
Old 09-21-2001, 03:41 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
flags are not cool
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.