[Gamemode] Battle

Started by Xann^, Aug 12, 2023, 11:01 AM

Previous topic - Next topic

Xann^

Functions:
Snippet has been made by Xann, a very simple and basic usage!

//Classes//

class Assault
{
Assault = null;
}

//==============FUNCTIONS=================//

function onAssault()
{
Assault = true;
}

function offAssault()
{
Assault = false;
}

function Respawn(player)
    {
       
        if ( onAssault )
{
            player.Pos = Vector(-1759.98, -193.022, 14.8683);
        }
    }

 //onPlayerSpawn

function onPlayerSpawn( player )
{
if ( onAssault )
{
Respawn(player);
}
}
 
   //Commands
if ( cmd == "battle" )
 {
if(!text) MessagePlayer( "Error - Correct syntax - /battle <join/leave>' !",player );
else
{
 if( text == "join" )
  {
onAssault();
player.World = 2;
Message( "[#FFFFFF]* " + player.Name + " Has joined the Battle!" );
player.Pos = Vector(-1759.98, -193.022, 14.8683);
  }

else if ( text == "leave" )
{
offAssault();
player.World = 0;
Message( "[#FFFFFF]* " + player.Name + " has left the battle" );
}
 }
 }
else if( cmd == "cmds" )
{
MessagePlayer("Gamemode: Battle", player );
MessagePlayer("Commands: Battle(join/leave)", player );
}
else if( cmd == "credits" )
{
MessagePlayer( "[#FFFFFF]Snippet made by Xann.",player );
return 0;
}

Note: Ignore my mistakes, as being a newbie over here posting my snippet/script.

Gamemode: This is called a gamemode, because honestly you can just use this as a battle gamemode, where you can play, duel whatever you wanna, everything is basic.

Suggestion: I do suggest you to use MR.SK's Spawnwep system for this.
Yo there.

Xann^

Credits: Sebyy(Sebastian)

I have used his, function onPlayerSpawn
Yo there.

habi


H.a.S.a.N