stopmusic on timer, or you could make it like:1
process "listening",2000,"stopmusic_event";
1
2
3
4
2
3
4
on:stopmusic_event
	{
	stopmusic;
	}
Scripts
Scripting Questions
stopmusic on timer, or you could make it like:process "listening",2000,"stopmusic_event";
on:stopmusic_event
	{
	stopmusic;
	}
on:start {
clear;
	add "Hello";
	add "This is the text";
	add "thats all";
	diary "yay";
	free "self";
}
clear clears previous texts.
add puts the mensage.
diary is the diary laucher and the title.
free does not allow a repeat (i think).on:start {
	diary "yay","diary.txt:*:","diary01";
	free "self";
}
) and put in the text this://~diary01 Hello. This is the text. !4Green mensage
. #Iron Sword
id=933
name=Iron Sword
group=weapon
icon=gfx\sword.bmp
model=gfx\sword.b3d
scale=1.6
behaviour=blade
mat=metal
weight=1000
damage=3
info=A simple Iron sword
healthchange=0
script=start
	on:impact {
		$tmp=impact_class();
		$tmp2=impact_id();
		//+14 Bonus Damage on Flesh
		if (compare_material("$tmp",$tmp2,"flesh")==1){
			damage "$tmp",$tmp2,14;
			if (skillvalue("Sword")>=500){
				damage "$tmp",$tmp2,20;
				addstate "$tmp",$tmp2,"bleeding";
			}elseif (skillvalue("Sword")>=420){
				damage "$tmp",$tmp2,15;
				$tmp3=random (1,2);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=360){
				damage "$tmp",$tmp2,12;
				$tmp3=random (1,4);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=250){
				damage "$tmp",$tmp2,8;
				$tmp3=random (1,5);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=200){
				damage "$tmp",$tmp2,5;
				$tmp3=random (1,8);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}
			if ($swordattack==2) {
				$noattack=1;
				timer "unit",1,750,0,"swordtimer";
				damage "$tmp",$tmp2,6;
				$swordtimer=1;
			}elseif($swordattack==3){
				$noattack=1;
				timer "unit",1,1250;
				$swordtimer=1;
				heal "$tmp",$tmp2,5;
				$tmp4=random (1,15);
				if($tmp4==5){
					kill $tmp2;
				}
			}
		}
		freevar $tmp;
		freevar $tmp2;
		freevar $tmp3;
		freevar $tmp4;
		if (health("$tmp",$tmp2)==0){
	event "iskill_swordmaster","global";
		}
	}
	on:swordtime{
		$noattack=0;
		msg "ready",4;
		freetimers "unit",1;
	}
	on:attack1{
		if ($noattack==1){
			skipevent;
		}
	}
	on:use{
		event "attack2";
	}
	on:attack2{
		$swordattack+=1;
		if($swordsetattack==1) {
			msg "Slash",4;
		}elseif($swordsetattack==2) {
			msg "Lunge",2;
		}elseif($swordsetattack==3) {
			msg "Bash",3;
		}
	}
script=end
on:timer{
		if ($swordtimer==1){
			event "swordtime","global";
		}
	}
I used:on:attack1
	{ skipevent; }
#Iron Broadsword
id=932
name=Iron Broadsword
group=weapon
icon=gfx\broadsword.bmp
model=gfx\broadsword.b3d
scale=1.6
behaviour=blade
mat=metal
weight=1250
damage=5
info=An iron sword with a very broad blade.
healthchange=0
script=start
	on:impact {
		$tmp=impact_class();
		$tmp2=impact_id();
		//+19 Bonus Damage on Flesh
		if (compare_material("$tmp",$tmp2,"flesh")==1){
			damage "$tmp",$tmp2,19;
			if (skillvalue("Sword")>=500){
				damage "$tmp",$tmp2,20;
				addstate "$tmp",$tmp2,"bleeding";
			}elseif (skillvalue("Sword")>=420){
				damage "$tmp",$tmp2,15;
				$tmp3=random (1,2);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=360){
				damage "$tmp",$tmp2,12;
				$tmp3=random (1,4);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=250){
				damage "$tmp",$tmp2,8;
				$tmp3=random (1,5);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}elseif (skillvalue("Sword")>=200){
				damage "$tmp",$tmp2,5;
				$tmp3=random (1,8);
				if ($tmp3==1) {
					addstate "$tmp",$tmp2,"bleeding";
				}
			}
			if ($swordattack==2){
				$noattack=1;
				timer "self",750;
				heal "$tmp",$tmp2,7;
				$swordtime=1
			}elseif($swordattack==3){
				$noattack=1;
				timer "self",1250;
				damage "$tmp",$tmp2,8;
				$tmp4=random (1,10);
				$swordtime=1
				if($tmp4==5){
					kill $tmp2;
				}
			}
		}
		freevar $tmp;
		freevar $tmp2;
		freevar $tmp3;
		freevar $tmp4;
		if(lives("$tmp",$tmp2)==1){
			event "iskill_swordmaster","global";
		}
	}
	on:attack1{
		if ($noattack==1){
			skipevent;
		}
	}
	on:use{
		event "attack2";
	}
	on:attack2{
		$swordsetattack++;
		if($swordsetattack==1) {
			msg "Slash",4;
		}elseif($swordsetattack==2) {
			msg "Lunge",2;
		}elseif($swordsetattack==3) {
			msg "Bash",3;
		}elseif($swordsetattack==4) {
			$swordsetattack=1;
			msg "Slash",4;
		}
	}
script=end
on:swordtimer{
		if ($swordtimer==1){
			$noattack=0;
			msg "ready",4;
			freetimers "unit",1;
		}
	}
setat "object",id,"unit",1; to set the item to the player position.
setrot "object",id,0,getyaw("unit",1),0; to set the yaw rotation of the object to the rotation of the player.
rpos "object",id,0,0,10; to move the object to the front of the player (if you want to have it in his front). you have to test around here. 10 might be okay but maybe you have to use a higher or lower value there to even see the object.
I've read your posts and this works great. I just have to work a bit on rotation cause it doesn't want to work fine (if you look at one direction, the object is on the left side of screen, and if you look in the opposite direction, it's on the right side of the screen, while I want it to stay on one side, hmm) $id=currentid();
		setat "object",$id,"unit",1;
		setrot "object",$id,0,getyaw("unit",1),0;
		timer "self",30,1,"checkpos";
freevar $tmp;
freevar $tmp2;
freevar $tmp3;
freevar $tmp4;
if(lives("$tmp",$tmp2)==1){
event "iskill_swordmaster","global";