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.

Juggernaut Script?

Custom scripts
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

Re: Juggernaut Script?

Post by KliPeH » Fri Oct 23, 2020 10:04 am

Could it be the Demon script?
0 x
 
Image

DottyScotty
Meatbag
Posts: 1
Joined: Sat Oct 24, 2020 5:38 am
Gender:

Post by DottyScotty » Sat Oct 24, 2020 5:57 am

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

User avatar
Odex64
Superfighter
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

Post by Odex64 » Sat Oct 24, 2020 9:21 am

You probably mean Exsceses' Boss Rush script. He made a lot of "everyone vs boss" scripts but almost all of them are private.
0 x
Image

User avatar
Odex64
Superfighter
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

Post by Odex64 » Thu Oct 29, 2020 2:14 pm

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..

Code: Select all

IPlayer ply = Game.GetPlayers()[rand.Next(Game.GetPlayers().Count())];
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:

Code: Select all

ply.SetModifiers(new PlayerModifiers() { CurrentHealth = 300, MeleeForceModifier = 2 }); //ETC..
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.
0 x
Image

Post Reply