Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   haulting default sword (https://forums.graalonline.com/forums/showthread.php?t=134259799)

sssssssssss 07-12-2010 12:09 AM

haulting default sword
 
Was wondering if there is a way to if the player hits s, and a certain condition isn't met, lets just say a var isnt true, it does nothing, but once it is true, they can hit default style?

DustyPorViva 07-12-2010 12:12 AM

You can stop the player from visually seeing their sword slashing, and can maybe stop it from damaging other players, but processes like bush cutting will be accomplished before whatever script you have running will be able to stop it. I also don't think you can stop the player from pausing for a moment, but you may.

12171217 07-12-2010 12:13 AM

Can't you just disable weapons and use a manual key check for the weapon firing instead?

xAndrewx 07-12-2010 12:15 AM

Kinda

You could do a timeout but it's not a good choice.

For example

HTML Code:

function onCreated() {
  setTimer(0.05);
}

function onTimeout() {
  if (condition1) temp.canswing = true;
  if (player.ani != "swim") temp.canswing = true;
  if (player.dead == false) temp.canswing = true;

  if (keydown(5) && temp.canswing) {
    setani("sword", "");
  } else {
    setani("idle", "");
  }
 
  setTimer(0.05);
}


DustyPorViva 07-12-2010 12:16 AM

Quote:

Originally Posted by 12171217 (Post 1587092)
Can't you just disable weapons and use a manual key check for the weapon firing instead?

This is typically the direction suggested.

sssssssssss 07-12-2010 12:17 AM

Quote:

Originally Posted by 12171217 (Post 1587092)
Can't you just disable weapons and use a manual key check for the weapon firing instead?

Didnt even think about that honestly. xD Will try and see if it interferes with anything.

I know there was a thread on manual key checks for firing weapons, but cant seem to find it for some reason now. Anyone know what I'm talking about?

sssssssssss 07-12-2010 12:36 AM

enable/disableweapons doesnt even seem to bother working in this case. -_-

cbk1994 07-13-2010 06:42 AM

Quote:

Originally Posted by sssssssssss (Post 1587098)
enable/disableweapons doesnt even seem to bother working in this case. -_-

There is probably a background script interfering. From RC try "/scriptscan weapons enableweapons" and look at the results.


All times are GMT +2. The time now is 06:12 PM.

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