Jump to content

Photo

Problem with Combining Global Scripts


  • Please log in to reply
2 replies to this topic

#1 Zagut

Zagut

    Experienced Forumer

  • Members
  • Location:Somewhere in the universe.

Posted 18 June 2017 - 07:13 PM

There are 3 scripts I'm trying to import into my quest: moosh's Bottles, Moosh's Pits, and Ghost ZH.

 

Each of these scripts have Global scripts that go with them.
I tried to combine them, but I can't seem to get them to work.

Below are the combined Global Scripts.

global script MooshPitGlobal{
	void run(){
		RefreshBottles();
		while(true){
			EmptyBottleGlobal();
			Waitdraw();
			Waitframe();
		}
                MooshPit_Init();
		while(true){
			MooshPit_Update();
			Waitframe();
		}
        StartGhostZH();
        
        while(true)
        {
            UpdateGhostZH1();
            Waitdraw();
            UpdateGhostZH2();
            Waitframe();
        }
    }
}

This Code is only running the Empty Bottle script by Moosh, and is ignoring the Pits and Ghost.zh.

I just can't figure out how to fix it.

Does anyone know how to fix this?


Edited by Zagut, 18 June 2017 - 07:13 PM.


#2 Saffith

Saffith

    IPv7 user

  • Members

Posted 18 June 2017 - 07:24 PM

You can't just stick one after the other. Generally, global scripts are divided into three parts:
global script GlobalScript
{
    void run()
    {
        // Part 1 here
        while(true)
        {
            // Part 2 here
            Waitdraw();
            // Part 3 here
            Waitframe();
        }
    }
}
You have to put the corresponding parts together. In this case:
global script CombinedGlobal{
	void run(){
		RefreshBottles();
		MooshPit_Init();
		StartGhostZH();
		while(true){
			EmptyBottleGlobal();
			MooshPit_Update();
			UpdateGhostZH1();
			Waitdraw();
			UpdateGhostZH2();
			Waitframe();
		}
	}
}

  • ShadowTiger, Lüt and Zagut like this

#3 Zagut

Zagut

    Experienced Forumer

  • Members
  • Location:Somewhere in the universe.

Posted 18 June 2017 - 09:38 PM

NOW it's working for me. Thanks alot!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users