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 01-16-2009, 02:25 AM
[email protected] jamerson61894@yahoo.com is offline
Banned
Join Date: Jul 2008
Posts: 83
jamerson61894@yahoo.com is an unknown quantity at this point
Red face 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
Reply With Quote
  #2  
Old 01-16-2009, 02:50 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
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");

__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 01-16-2009, 03:01 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
or...

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

__________________
Reply With Quote
  #4  
Old 01-16-2009, 04:37 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by cbk1994 View Post
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.
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 03:33 AM.


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