messed up pickup script

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

messed up pickup script

Post by darksmaster923 »

ok, i have multiple pickup scripts for guns. but the pp19 script doesnt work. when i pick it up with no gun, i dont get the pp19.
if i pick up with a gun, i get the ammo.
SCRIPT

Code: Select all

{
	pickup		[false]

	Spawn[ ()
	{
		Console(false);
		BoxWidth(80);
		BoxHeight(50);
		SetCollision();
		AddCollisionOrder("Setup");
	} ]

	Setup[ ()
	{
		LowLevel("Idle");
	} ]

	Idle[ ()
	{
		if(GetAttribute("galil","Player") < 1 and (GetAttribute("m16","Player") < 1) and (GetAttribute("famas","Player") < 1) and (GetAttribute("ak47","Player") < 1))
		{
			if(GetAttribute("mp7","Player") < 1 and (GetAttribute("mac","Player") < 1) and GetAttribute("ump","Player") < 1 and (GetAttribute("pp19","Player") < 1))
			{
				if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
				{
					if(GetAttribute("m3","Player") < 1)
					{
						if(pickup = false)
						{
							ModifyAttribute("pp19", 1, "Player");
							ModifyAttribute("smg_shell", random(25,80), "Player");
							PlaySound("respawn.wav");
							pickup = true;
							TeleportEntity("pp19" , "temp" );
							HighLevel("Wait");
						}
					}
					else
					{
						HighLevel("Spawn");
					}
				}
				else
				{
					HighLevel("Spawn");
				}
			}
			else
			{
				ModifyAttribute("smg_shell", random(55,120), "Player");
				PlaySound("respawn.wav");
				TeleportEntity("pp19" , "temp" );
			}
		}
		else
		{
			HighLevel("Spawn");
		}
	} ]

	Wait[ ()
	{
		Delay("", 1, "");
		pickup = false;
		NewOrder("Spawn");
	} ]
} 
Herp derp.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

I'm not sure if this will fix anything, but I recommend adding a couple of brackets in the if-statements.
For example:

Code: Select all

if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
should be

Code: Select all

if((GetAttribute("mg36","Player") < 1) and (GetAttribute("awp","Player") < 1))

Apart from that, I don't see anything wrong with your script. :?
Pain is only psychological.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

that doesnt do anything
Herp derp.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

Try to set Console(true) instead of Console(false) and look what the console says...
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

the consoles completely normal....
Herp derp.
Post Reply