Jump to content

In need of a pvp skript


cuppalemontee

Recommended Posts

Hello, over the course of the last few hours I've been looking for skripts, plugins, exc. and can't seem to find what I'm looking for. If possible, could someone please write the following in skript?

Combat tag is 10 sec, if player1 gets killed by player2 while in combat, 1 death gets added to player1 and kill gets added to player2. If for example player1 and player2 are in combat, and player1 falls into the void, drowns, exc. the kill gets added to player2.)

Broadcasted death messages please

 

Finally, some sort of killstreak. Every 5 kills a player gets on a killstreak it broadcasts it in game.


To anyone that takes their time to do this, thanks. I understand it is a lot to ask for however it will be greatly appreciated. If you want to contact me, my discord is Aidennn#0682. Thanks!

Link to comment
Share on other sites

  • 2 weeks later...
options:
	combatTagTime: 10 #The time needed until combat tag is removed (in seconds)
	tagMsg: "&6You are now in combat" #Message players receive when they get in combat
	noTagMsg: "&6You are no longer in combat" #Message players receive when they aren't in combat
	killMsg: "&6<victim> has been killed by <attacker>" #Broadcasted message when a player kills another player
	killstreakMsg: "&6<player> has a <number> kill streak!" #Broadcasted message every 5 killstreaks
	maxKillStreak: 20 #Change this value for more or less max kill streak. This value is multiplied by 10 (so 20 would be 200)

on leave:
	clear {combatTag::%player%}
	clear {killStreak::%player%}
	clear {lastCombat::%player%}

on damage of player:
	attacker is a player
	if {combatTag::%victim%} is not set:
		set {combatTag::%victim%} to true
		set {lastCombat::%victim%} to attacker
		send {@tagMsg} to victim
	if {combatTag::%attacker%} is not set:
		set {combatTag::%attacker%} to true
		send {@tagMsg} to attacker
	wait {@combatTagTime} seconds
	clear {combatTag::%victim%}
	clear {combatTag::%attacker%}
	clear {lastCombat::%victim%}
	send {@noTagMsg} to victim
	send {@noTagMsg} to attacker

on death of player:
	if {combatTag::%victim%} is not set:
		clear {killStreak::%victim%}
		add 1 to {deathCounter::%victim%}
	if {combatTag::%victim%} is set:
		add 1 to {deathCounter::%victim%}
		set {_killer} to {lastCombat::%victim%}
		clear {combatTag::%victim%}
		clear {killStreak::%victim%}
		clear {lastCombat::%victim%}
		add 1 to {killStreak::%{_killer}%}
		add 1 to {killStreak::%{_killer}%}
		if {killStreak::%{_killer}%} >= 5:
			set {_ksamount} to floor(({killStreak::%{_killer}%})/5)
			set {_int} to {@maxKillStreak}
			loop {@maxKillStreak} times:
				add {_int} to {_list::*}
				remove 1 from {_int}
			set {_list::*} to (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
			if {_list::%{_ksamount}%::%{_killer}%} is not set:
				set {_list::%{_ksamount}%::%{_killer}%} to true
				set {_killstreak} to 5*{_ksamount}
				set {_broadcast} to {@killstreakMsg}
				replace "<player>" in {_broadcast} with "%{_killer}%"
				replace "<number>" in {_broadcast} with "%{_ksamount}%"
				broadcast "%{_broadcast}%"

I didn't test this code out, so if any errors come up, or if something doesn't work, please let me know! Hope this helps (and if it does, please leave a reaction!)

EDIT: I realized a mistake I made in the skript and fixed it.

Edited by BanditEagle
  • Like 1
  • Thanks 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

On 5/7/2022 at 4:48 PM, cuppalemontee said:

Thank you!

No problem at all! I'm glad I was able to help! I would really appreciate it if you could leave a reaction to my post if I was able to help you out!

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
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
×
×
  • Create New...