![]() |
can soemone help me with this Basic Gun Script
:confused:
Script : //#CLIENTSIDE function onWeaponFired() { if (this.on == false) { this.on = true; client.gani_idle = "light-old_rifle-idle"; onTimeout(); } else{ this.on = false; showsword(1); player.chat = "Gun Deactivated!"; client.gani_idle = "idle"; client.gani_walk = "walk"; } } function onTimeout() { if (this.on == true) { hidesword(1); player.chat = "Gun Activated!"; client.gani_idle = "light-old_rifle-idle"; client.gani_walk = "light-old_rifle-walk"; } } function onKeyPressed( code, key ) { if ( key == "s" ) { hidesword(1); setani("light-old_rifle-fire", ""); freezeplayer(0.1); setshootparams("Rifle", player.account); shoot(player.x, player.y, 0, player.dir,0 ,0 , "utopia_bullet", "0.5"); } } function onPlayerChats(){ if (player.chat == "Reload"){ { client.gani_idle = "light-old_rifle-reload"; sleep(0.25); client.gani_idle = "light-old_rifle-idle"; } } } |
Please use the PHP tags and style your scripting. This way it is easier to read through your script. Also tell us what exactly is wrong in your script.
(example of styling and using PHP tags) PHP Code:
|
Could you please explain what's not working, what you're trying to get to, and as stated by Dan, use PHP tags?
|
Quote:
|
Proper styling
This one's better styled (how it should be);
PHP Code:
|
PHP Code:
|
Quote:
|
Rofl, this thread is hilarious.
|
God help you.
Function parameters go inside the parenthesis. replaceani("idle", "mycustomani"); |
You definitely have to be more specific....what about it doesn't work? Does the gun 'equip'? Shoot bullets which don't damage players? Doesn't shoot bullets? Spawns a ferret of mass unholy destruction which feasts on the sorrows of 7 2/6 year old children?
Also, do you actually work for Utopia or did you just 'source' this script without any understanding of it? |
Not from Utopia lol.
Chris made our gun system (Thanks again!) |
LOL he took Dans example of styling a bit too literal and tried to make a script of that.
Why is there a timeout to begin with :confused: |
He came here asking for help, not to be insulted for trying to learn something. If he knew exactly what he was doing chances are he wouldn't be here to begin with.
|
Quote:
|
Quote:
http://wiki.graal.net/index.php/GScript If you want to learn how to script then read this. |
| All times are GMT +2. The time now is 09:17 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.