Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Noob Scripter Needs Help (https://forums.graalonline.com/forums/showthread.php?t=134265343)

Equinox 12-20-2011 11:22 PM

Noob Scripter Needs Help
 
Okay, So i found a script on the forums made by 0pix0, i was trying to find out how to use it. This is the file I'm trying to get to play.

http://dc111.4shared.com/img/1025681...00/preview.mp3
PHP Code:

function onCreated() {
  
setshape(13232);
  
setSong("default.mp3");
}

function 
onPlayerChats() {
  
temp.tokens player.chat.tokenize();
  if (
tokens[0] == "playsong") {
    if (
fileexists(tokens[1])) {
      if (
tokens[1] != this.attr[10]) {
        
setSong(tokens[1]);
      }
    }
  }
}

function 
setSong(temp.filename) {
  
this.attr[10] = filename;
  
triggeraction(this.1this.1"SongChanged"filename);
}

//#CLIENTSIDE
function onCreated() {
  
setshape(13232);
}

function 
onPlayerEnters() {
  
setSong(this.attr[10]);
}

function 
onActionSongChanged(temp.filename) {
  
setSong(filename);
}

function 
setSong(temp.filename) {
  
stopmusic();
  
playlooped(filename);



fowlplay4 12-20-2011 11:25 PM

Adjust the setsong line at the top:

setSong("http://dc111.4shared.com/img/1025681414/518dfb3c/dlink__2Fdownload_2FcnQx4WZ-_3Ftsid_3D00000000-000000-00000000/preview.mp3");

Equinox 12-20-2011 11:27 PM

Thanks,
I still can't get it to work?

Tolnaftate2004 12-20-2011 11:46 PM

Intra-NPC triggers from server to client are impossible without an intermediate. I wouldn't recommend it. Instead, trigger a weapon to play the song.


All times are GMT +2. The time now is 10:20 AM.

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