Effectsmp

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

robo2573

Member
Jun 6, 2024
3
0
1
24
Hello I am a new scripter I started around a month ago and I need help with a effectsmp script this skript is supposed to give the player strength 1 on first kill, speed 1 on next and so on (both are supposed to max out at 3)


Heres the skript I have!

on death of player:
if attacker is a player:
broadcast "%victim% died to %attacker%"
execute console command "effect clear %victim%"

unless score %victim% hasStrength matches 1 if score %attacker% hasStrength matches 1:
broadcast "%attacker% has potion of strength!"
execute console command "effect clear %attacker% minecraft:strength"
execute console command "effect give %attacker% minecraft:speed 999999 2 true"
if else:
broadcast "%attacker% does not have potion of strength!"
execute console command "effect give %attacker% minecraft:strength 999999 2 true"
execute console command "scoreboard players set %attacker% hasStrength 1"
 
Updated skript:
Does not 100% work

on death of player:
if attacker is a player:
broadcast "%victim% died to %attacker%"
execute console command "effect clear %victim%"

unless score %victim% hasStrength matches 1 if score %attacker% hasStrength matches 1 run
broadcast "%attacker% has potion of strength!"
execute console command "effect clear %attacker% minecraft:strength"
execute console command "effect give %attacker% minecraft:speed 999999 0 true"
else:
broadcast "%attacker% does not have potion of strength!"
execute console command "effect give %attacker% minecraft:strength 999999 0 true"
execute console command "scoreboard players set %attacker% hasStrength 1"


on death of player:
execute console command "effect give %attack% %effect% infinite +1 true"
 
Updated skript:
Does not 100% work

on death of player:
if attacker is a player:
broadcast "%victim% died to %attacker%"
execute console command "effect clear %victim%"

unless score %victim% hasStrength matches 1 if score %attacker% hasStrength matches 1 run
broadcast "%attacker% has potion of strength!"
execute console command "effect clear %attacker% minecraft:strength"
execute console command "effect give %attacker% minecraft:speed 999999 0 true"
else:
broadcast "%attacker% does not have potion of strength!"
execute console command "effect give %attacker% minecraft:strength 999999 0 true"
execute console command "scoreboard players set %attacker% hasStrength 1"


on death of player:
execute console command "effect give %attack% %effect% infinite +1 true"
A huge tip I can give you is to avoid using 'execute console command' if you can help it. Skript has many already built in statements/conditions that allow you to apply potion affects, save individual player score values, and much more in shorter (More effective) lines as compared to longer lines. Check out the links I provided below which should help optimize and improve your code:

https://docs.skriptlang.org/docs.html?search=#EffPotion
https://docs.skriptlang.org/docs.html?search=#StructVariables