Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.
New to the forum? Say hello in this topic! Also make sure to read the rules.
New to the forum? Say hello in this topic! Also make sure to read the rules.
Juggernaut Script?
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
-
- Meatbag
- Posts: 1
- Joined: Sat Oct 24, 2020 5:38 am
- Gender:
Hey OREO, DottyScotty here, we were the ones that played together on the server! The juggernaut script is one that I created myself! Here is the code that you can put into a text file:
Code: Select all
static Random rand = null;
public void OnStartup(){
rand = new Random();
int count = 0;
int playerCount = 0;
foreach(IPlayer ply in Game.GetPlayers()){
playerCount = playerCount + 1;
}
int jugger = rand.Next(1, playerCount + 1);
foreach(IPlayer ply in Game.GetPlayers()){
count = count + 1;
if (count == jugger){
PlayerModifiers modify = ply.GetModifiers();
modify.MaxHealth = (playerCount - 1) * 100;
modify.RunSpeedModifier = 1.5f;
modify.SprintSpeedModifier= 1.5f;
ply.SetModifiers(modify);
ply.SetTeam(PlayerTeam.Team1);
ply.SetHealth((playerCount - 1) * 100);
Game.ShowPopupMessage(ply.Name + " is the Juggernaut!");
}
else{
ply.SetTeam(PlayerTeam.Team2);
}
}
}
0 x
- Odex64
- Superfighter
- Posts: 172
- Joined: Sat Jul 29, 2017 12:39 pm
- Title: Content Creator
- SFD Account: Odex64
- Started SFD: PreAlpha
- Location: Italy
- Gender:
- Age: 22
I don't even know why I'm writing this (apparently I've got a lot of free time).
First of all I'd fix your script before adding further throw and super jumps. I noticed your friend declared 3 useless variables and did 2 foreach loops (which aren't necessary); a much better way to take the boss is declaring an IPlayer variable and directly assign it to a random player..
this piece of code will make your script shorter and better ^^.
You can also assign modifiers and profiles in just one line of code, just like that:
You can use the PlayerWeaponRemoved event and increase the linear velocity to make longer throws.
You can also use a the UpdateCallback or PlayerMeleeActionCallback to make super jumps (increase the (y)linear velocity).
Said that, good luck with improving and finishing your script.
First of all I'd fix your script before adding further throw and super jumps. I noticed your friend declared 3 useless variables and did 2 foreach loops (which aren't necessary); a much better way to take the boss is declaring an IPlayer variable and directly assign it to a random player..
Code: Select all
IPlayer ply = Game.GetPlayers()[rand.Next(Game.GetPlayers().Count())];
You can also assign modifiers and profiles in just one line of code, just like that:
Code: Select all
ply.SetModifiers(new PlayerModifiers() { CurrentHealth = 300, MeleeForceModifier = 2 }); //ETC..
You can also use a the UpdateCallback or PlayerMeleeActionCallback to make super jumps (increase the (y)linear velocity).
Said that, good luck with improving and finishing your script.
0 x