BattleServerKit

Approved BattleServerKit 1.1.4

No permission to download
I fixed it myself :)
Code:
function On_PlayerConnected(Player, player){
   if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true && Player.Inventory.FreeSlots == 33){
        Player.Inventory.ClearAll();
//add item spawn code here//
  }else{
     if(Player.Inventory.HasItem("Rock") == true){
       Player.Inventory.RemoveItem("Rock");
     }
   }
}
function On_PlayerSpawned(Player, SpawnEvent){
    if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true && Player.Inventory.FreeSlots == 33){
        Player.Inventory.ClearAll();
//add item spawn code here//
  }else{
     if(Player.Inventory.HasItem("Rock") == true){
       Player.Inventory.RemoveItem("Rock");
     }
   }
}
 
Last edited:
Would be great if you could add the config, as i think most people would want to change the items.
Cheers.
 
There is a problem. When i join and reconnect i get the starting gear again my inventory.
 
Is it possible to make it so the gun spawns reloaded? I ve seen it in Oxide/Rust Essentials.
 
Is it possible to make it so the gun spawns reloaded? I ve seen it in Oxide/Rust Essentials.
It already does,
In the LoadOut file
Code:
[HotBar]
Item0=P250
Qty0=8
Item1=MP5A4
Qty1=30
Item2=Large Medkit
Qty2=5
Item3=Large Medkit
Qty3=5
Item4=Small Rations
Qty4=10
Item5=Hatchet
Qty5=1
When you add a weapon make the Qty equal to the max amount that weapon can have.
E.G:
Item0=P250
Qty0=8 //Will spawn the P250 fully loaded with 8 bullets
Item1=MP5A4
Qty1=10 //Will spawn the MP5 loaded with 10 bullets

NOTE:
Only works for hotbar (Not sure for inventory)
 
  • Like
Reactions: h0wHigh
It already does,
In the LoadOut file
Code:
[HotBar]
Item0=P250
Qty0=8
Item1=MP5A4
Qty1=30
Item2=Large Medkit
Qty2=5
Item3=Large Medkit
Qty3=5
Item4=Small Rations
Qty4=10
Item5=Hatchet
Qty5=1
When you add a weapon make the Qty equal to the max amount that weapon can have.
E.G:
Item0=P250
Qty0=8 //Will spawn the P250 fully loaded with 8 bullets
Item1=MP5A4
Qty1=10 //Will spawn the MP5 loaded with 10 bullets

NOTE:
Only works for hotbar (Not sure for inventory)

Ahh i see, thought that was just for how many you can give (item wise) Cheers man.
 
  • Like
Reactions: Jakkee
It already does,
In the LoadOut file
Code:
[HotBar]
Item0=P250
Qty0=8
Item1=MP5A4
Qty1=30
Item2=Large Medkit
Qty2=5
Item3=Large Medkit
Qty3=5
Item4=Small Rations
Qty4=10
Item5=Hatchet
Qty5=1
When you add a weapon make the Qty equal to the max amount that weapon can have.
E.G:
Item0=P250
Qty0=8 //Will spawn the P250 fully loaded with 8 bullets
Item1=MP5A4
Qty1=10 //Will spawn the MP5 loaded with 10 bullets

NOTE:
Only works for hotbar (Not sure for inventory)

This does not work for me.

EDIT: nope sorry, my mistake. It works well now.
It's possible to add weapons already modded in hotbar?
 
Last edited:
This does not work for me.

EDIT: nope sorry, my mistake. It works well now.
It's possible to add weapons already modded in hotbar?
Yeah its possible with some modification to the code
Something like this:
Python:
Player.Inventory.AddItemTo("M4", "1", 30)
weapon = Player.Inventory.Getitem("M4")
weapon.SetTotalModSlotCount(4)
weapon.SetUses(30)
weapon.AddMod(rust.GetDatablockByName("Holo sight"))
weapon.AddMod(rust.GetDatablockByName("Silencer"))
weapon.AddMod(rust.GetDatablockByName("Laser Sight"))
 

Similar threads