![]() |
Shovel Script
Hi, im working on my shovel script still and I am attempting to make it so that when you press d, it shovels, (<--that part alraedy works), and you
randomely get one of 3 weapons. Lets call them "Treasure/Map", "Treasure/Chest", and "Treasure/Key". Basically, I would like to know how randomely adding a weapon would be dont with int ( random(. Thanks. |
You could do something like:
PHP Code:
|
Well this is the script.
PHP Code:
|
Search the forums for examples on how to use triggerserver, and on ActionServerSide.
You need to use them to call your doAddItems function on the serverside. |
Also try using == for if check statements.
|
ok I got it to work, but on my systems, we use clientr.item.ITEMNAME=QUANTITY.
How would I get it to add 1 quantity when it adds the weapon? heres what I have right now. PHP Code:
|
Hmm its not adding clientr.item.NAME=QUANTITY
|
basically, the quantity is nothing when it adds it to you, and that defeats the purpous of the script because after you make the treasure, you sell it for cash. And quantity counts.
|
Could someone else help me?
|
PHP Code:
Also, if your servers systems are any good they would have a public function for adding items... like: Inventory.additem(itemname,quantity); If they don't, get them to add it. |
if ( player.level == "jamerson-shovel.nw" )
= is equals 1 + 1 = 2 == is for comparisons if a is like b if ( a == b ) |
Dusty your script doesn't even add the weapons!
help? |
Quote:
|
Quote:
|
-
[email protected], I suggest you look through the Graal Wikipedia. It will help you a lot quicker than asking for help here. It may also benefit you to collaborate with another scripter so you can learn more about the language. |
All times are GMT +2. The time now is 04:13 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.