Sign in to follow this  
[FR] zakhy

I am looking for a script for randomness

7 posts in this topic

If I understand your post, you are interested in random spawns?  Meaning when you die and respawn the player doesn't get to choose where they re-spawn in, it's a random choice made by the server?

If so, I haven't done it myself but found this on the forum that might help you;


  • Like 1

Share this post

Link to post
Share on other sites

//Random loadout by Pattoh
private ["_uniforms", "_headGear", "_pistols", "_vests", "_inventoryItems", "_backpacks", "_linkItems", "_howManyClips", "_addMagZ"];

_uniforms =  selectRandom  [
_headGear =  selectRandom  [

_pistols =	selectRandom 	[					
_vests = selectRandom 	[					
_inventoryItems =	[					

_backpacks = selectRandom 	[					

_linkItems =					[					

player addHeadgear _headGear;
player addVest _vests;
player forceAddUniform _uniforms;

	player linkItem _x;
} forEach _linkItems;

waitUntil {uiSleep 0.5; ((getPosATL player select 2 < 1) && (vehicle player == player))};
player addBackpack _backpacks;

player addWeapon _pistols;

	player addMagazine _x;
} forEach _inventoryItems;

switch (true) do 
	case (ExileClientPlayerScore >= 50000 && ExileClientPlayerScore <= 99999):
		_howManyClips = 3;
	case (ExileClientPlayerScore >= 100000 && ExileClientPlayerScore <= 499999):
		_howManyClips = 4;
	case (ExileClientPlayerScore >= 500000):
		_howManyClips = 5;
		_howManyClips = 2;

//serena thanks
Fn_Gear_CompatibleMagazines = { 
 private _cls = configFile >> "CfgWeapons" >> _this; 
 private _res = []; 
 {_res pushBack (if (_x == "this") 
  then {getArray(_cls >> "magazines")}); 
 } forEach getArray(_cls >> "muzzles"); 

//serena again
AddmagZ = { 
 private _play = player; 
 { if (count _x > 0) then { 
   { if (count _x > 0) then {    
     _play addMagazines [(_x select 0),_howManyClips]} 
   } foreach (_x call Fn_Gear_CompatibleMagazines)  
 } forEach [primaryWeapon _play, handgunWeapon _play]; 

player addMagazine call AddmagZ;


A good start is this.

Name the above Randout.sqf and place it in a folder called 'custom' inside the mission file folder.

Add the below to your own ExileClient_object_player_network_createPlayerResponse.sqf (you will need to override in the CFGcustomCode section) add this right down the bottom but just before the last like where it says 'true'.

[] execVM "custom\Randout.sqf"; 

Make sure you remove any starting items in your config.cpp then you should be good then.

This also adds extra clips for the starting guns, that scale with your respect.

Edited by Pattoh
  • Like 1

Share this post

Link to post
Share on other sites

@[FR] zakhy yes, I have approximately 20 different uniforms and other components in mine.

In the Github, look at the "Randomised Loadout" version.

In the file  ExileServer_object_player_network_createPlayerRequest.sqf  you'll see there variables with arrays such as "_bambiUniforms = selectRandom" all you need to do is add the components you want into the appropriate array.

See how you go.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.