esn23
Active member
Sorry Im rather new to scripts and my friend bloodbane set me up with this script. I believe he added the bottom part to it to make it centered.. But the script is crashing the game.. I am very sure it is something simple im missing but I have been out of the scene for so long lol i don't know what it is and i don't want to screw it up more lol.. Anywho here is the script...
Here is the error
Can't compile script 'cycunlock' data/chars/misc/unlock/cycunlock.txt
Code:
void main(){
// Custom sounds for picking itens
// Douglas Baldan / O Ilusionista - 11/12/2016
// Thanks Damon Caskey for the support
void self = getlocalvar("self"); //get the self var
void hit = getlocalvar("damagetaker"); // get target entity
char Name = getentityproperty(self,"name"); // get target's name
void power = getentityproperty(hit,"mp"); // get target's current mp
int Screen = openborvariant("hResolution"); // Get screen width
int VScreen = openborvariant("vResolution"); // Get screen height
int SFX1 = loadsample("data/chars/misc/unlock/unlockbea.wav"); // load samples
int SFX2 = loadsample("data/chars/misc/unlock/unlockcyc.wav");
int SFX3 = loadsample("data/chars/misc/unlock/unlockemm.wav");
int SFX4 = loadsample("data/chars/misc/unlock/unlocksto.wav");
switch(Name) { // check the item name
case "unlockbea" : // unlock beast
playsample(SFX1, 0, 120, 120, 100, 0);
spawnAni("beaunlock",Screen/2,0,VScreen/2,"ANI_FOLLOW1");
loadmodel("Beast");
break;
case "unlockcyc" : // unlock cyclops
playsample(SFX2, 0, 120, 120, 100, 0);
spawnAni("cycunlock",Screen/2,0,VScreen/2,"ANI_IDLE");
loadmodel("Cyclops");
break;
case "unlockemm" : // unlock emma
playsample(SFX3, 0, 120, 120, 100, 0);
spawnAni("emmunlock",Screen/2,0,VScreen/2,"ANI_FOLLOW4");
loadmodel("Emma_Frost");
break;
case "unlocksto" : // unlock storm
playsample(SFX4, 0, 120, 120, 100, 0);
spawnAni("stounlock",Screen/2,0,VScreen/2,"ANI_FOLLOW3");
loadmodel("Storm");
break;
default : // in case of none of above
break;
}
}
void spawnAni(void vName, float fX, float fY, float fZ, void Ani)
{
//spawn relative to camera + Specific animation
//Damon Vaughn Caskey + Douglas Baldan + Bloodbane
//09/02/2021
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fY: Y location adjustment.
//fZ: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
int XPos = openborvariant("xpos"); //Get screen edge's position
int YPos = openborvariant("ypos"); // Get camera position
int Screen = openborvariant("hResolution"); // Get screen width
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if(iDirection == 0){ //Is entity facing left?
fX = Screen-fX; //Reverse X direction to match facing and screen length
}
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
performattack(vSpawn, openborconstant(Ani));
return vSpawn; //Return spawn.
}
Here is the error
Can't compile script 'cycunlock' data/chars/misc/unlock/cycunlock.txt