BattleServerKit

Approved BattleServerKit 1.1.4

No permission to download

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
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:

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
Would be great if you could add the config, as i think most people would want to change the items.
Cheers.
 

ViraL

Member
Member
Aug 19, 2014
50
4
8
There is a problem. When i join and reconnect i get the starting gear again my inventory.
 

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
Is it possible to make it so the gun spawns reloaded? I ve seen it in Oxide/Rust Essentials.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
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

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
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

PearlJ

Contributor
Contributor
Aug 14, 2014
86
17
8
34
Italy
misternerd.eu
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:

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
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"))