Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scripting question! (https://forums.graalonline.com/forums/showthread.php?t=83711)

[email protected] 01-16-2009 02:25 AM

Scripting question!
 
Hello, I made a go-kart for my server and I wanted to make it to where I can only use it in that level. Is there a way to script it to only let it be equipted in that level?

like :

disableweapon("go-kart:);

something like that.

thanks

-jamerson

Tigairius 01-16-2009 02:50 AM

You could just remove the weapon if it's not in that level. In the clientside part of your 'go-kart' you could do

PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  if (
player.level.name != "level.nw") {
    
this.destroy();
  }


Then in the level it's supposed to be used you can do (serverside):
PHP Code:

function onPlayerEnters() {
  
player.addWeapon("go-kart");



cbk1994 01-16-2009 03:01 AM

or...

PHP Code:

function onWeaponFired() {
  
// or whatever function is being called
  
if (player.level.name != "whatever.tig") {
    return;
  }
  
  
// all the code under here



Twinny 01-16-2009 04:37 AM

Quote:

Originally Posted by cbk1994 (Post 1457382)
or...

Using your method, then could activate the go-kart in the designated levels but then drive it out of the specified levels (unstick me anyone?). Tig's method is probably more appropriate in this case.


All times are GMT +2. The time now is 08:46 PM.

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