Graal Forums

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

Magadal 12-02-2006 04:00 PM

Staffblocks
 
Well...I made some test weapon and class for staffblocks, and also a script in the class to destroy them when its right clicked, but they will show again after updating the level or reconnecting.
I used putnpc2 to put them in the level, and the destroy command is clientside (if that helps).

I need some help please :D

michael7849 12-02-2006 04:02 PM

um welkl i have a staff block u can prob use but its on my server....

Twinny 12-02-2006 04:03 PM

The destroy(); has to be serverside for the npc to be completely removed. Otherwise you're just removing the instance for one person.

Magadal 12-02-2006 04:08 PM

Quote:

Originally Posted by Twinny (Post 1249337)
The destroy(); has to be serverside for the npc to be completely removed. Otherwise you're just removing the instance for one person.

Yea I also thought about that, but somehow it wont work if I put it serverside. I also already tried to trigger it, didnt work though.

Twinny 12-02-2006 04:12 PM

Triggers are evil in classes.

http://forums.graalonline.com/forums...ad.php?t=69691

Some methods were detailed in this post about getting triggers to work in classes.

coreys 12-02-2006 04:39 PM

Haha, Yeah.

I just had mine completely serverside (except for right clicking to get the commands.)

PHP Code:

function onCreated() {
  
image "uprising_staffblock.gif"//You can put your own image here.
  
drawunderplayer();
}
function 
onActionLeftMouse() {
  if (
player.account in serverr.admins) { //You can change this to whatever checks for staff powers
    
if (player.chat.starts("/destroy")) {
      
client.messages.add("Destroyed staffblock" SPC id); //The messages.add are for a messages system I had
      
destroy();
    }
    else if (
player.chat.starts("/message")) {
      
client.messages.add("Set message of staffblock" SPC id);
      
message(player.chat.substring(9,-1));
    }
  }



Magadal 12-03-2006 01:16 AM

Already got it to work because Twinny helped me ingame, but thanx anyways :P


All times are GMT +2. The time now is 01:17 AM.

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