Hey all so i wrote this skript to handle effects on a server i am building but i have noticed over time the server is lagging a little and when this skript is enabled some players timeout when joining but when disabled it is fine.
I have no where mastered skirpt yet and will still class myself as basic. sorry.
anyone know how i can make this more efficient?
I have no where mastered skirpt yet and will still class myself as basic. sorry.
anyone know how i can make this more efficient?
Code:
on left click:
player is holding glass or white stained glass or orange stained glass or magenta stained glass or light blue stained glass or yellow stained glass or lime stained glass or pink stained glass or gray stained glass or light gray stained glass or cyan stained glass or purple stained glass or blue stained glass or brown stained glass or green stained glass or red stained glass or black stained glass:
player is sneaking
if player is wearing a helmet or glass or white stained glass or orange stained glass or magenta stained glass or light blue stained glass or yellow stained glass or lime stained glass or pink stained glass or gray stained glass or light gray stained glass or cyan stained glass or purple stained glass or blue stained glass or brown stained glass or green stained glass or red stained glass or black stained glass:
send "&dCosmic &8» &7please remove your current helmet and try again."
if player is not wearing a helmet or glass or white stained glass or orange stained glass or magenta stained glass or light blue stained glass or yellow stained glass or lime stained glass or pink stained glass or gray stained glass or light gray stained glass or cyan stained glass or purple stained glass or blue stained glass or brown stained glass or green stained glass or red stained glass or black stained glass:
equip player with tool
remove 1 of tool from tool
#--- Main world ---#
on player world change:
wait 2 seconds
player is in "world":
remove slow falling from player
remove jump boost from player
remove wither effect from player
wait 1 seconds
apply potion of slow falling of tier 1 without any particles to the player for 1 day
apply potion of jump boost of tier 2 without any particles to the player for 1 day
every 5 seconds in world "world":
loop all players in world "world":
if loop-player doesn't have slow falling:
apply potion of slow falling of tier 1 without any particles to the loop-player for 1 day
if loop-player doesn't have jump boost:
apply potion of jump boost of tier 2 without any particles to the loop-player for 1 day
#----------------------#
#--- The Moon ---#
on player world change:
wait 2 seconds
player is in "Moon":
remove slow falling from player
remove jump boost from player
remove wither effect from player
wait 1 seconds
apply potion of slow falling of tier 4 without any particles to the player for 1 day
apply potion of jump boost of tier 4 without any particles to the player for 1 day
every 5 seconds in world "Moon":
loop all players in world "Moon":
if loop-player doesn't have slow falling:
apply potion of slow falling of tier 4 without any particles to the loop-player for 1 day
if loop-player doesn't have jump boost:
apply potion of jump boost of tier 4 without any particles to the loop-player for 1 day
if loop-player is not wearing glass or white stained glass or orange stained glass or magenta stained glass or light blue stained glass or yellow stained glass or lime stained glass or pink stained glass or gray stained glass or light gray stained glass or cyan stained glass or purple stained glass or blue stained glass or brown stained glass or green stained glass or red stained glass or black stained glass:
execute console command "/tm msg %loop-player% &d&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
apply potion of wither of tier 1 without any particles to the loop-player for 5 seconds
if loop-player is not wearing a chestplate:
execute console command "/tm msg %loop-player% &d&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
apply potion of wither of tier 1 without any particles to the loop-player for 5 seconds
if loop-player is not wearing a leggings:
execute console command "/tm msg %loop-player% &d&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
apply potion of wither of tier 1 without any particles to the loop-player for 5 seconds
if loop-player is not wearing a boots:
execute console command "/tm msg %loop-player% &d&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
apply potion of wither of tier 1 without any particles to the loop-player for 5 seconds
#---------------------#
#--- The Core ---#
on player world change:
wait 2 seconds
player is in "world_nether":
remove slow falling from player
remove jump boost from player
remove wither effect from player
wait 1 seconds
apply potion of slow falling of tier 1 without any particles to the player for 1 day
apply potion of jump boost of tier 2 without any particles to the player for 1 day
every 5 seconds in world "world_nether":
loop all players in world "world_nether":
if loop-player doesn't have slow falling:
apply potion of slow falling of tier 1 without any particles to the loop-player for 1 day
if loop-player doesn't have jump boost:
apply potion of jump boost of tier 2 without any particles to the loop-player for 1 day
if loop-player is not wearing glass or white stained glass or orange stained glass or magenta stained glass or light blue stained glass or yellow stained glass or lime stained glass or pink stained glass or gray stained glass or light gray stained glass or cyan stained glass or purple stained glass or blue stained glass or brown stained glass or green stained glass or red stained glass or black stained glass:
execute console command "/tm msg %loop-player% &c&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
set loop-player on fire
if loop-player is not wearing a chestplate:
execute console command "/tm msg %loop-player% &c&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
set loop-player on fire
if loop-player is not wearing a leggings:
execute console command "/tm msg %loop-player% &c&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
set loop-player on fire
if loop-player is not wearing a boots:
execute console command "/tm msg %loop-player% &c&lSuit Up!\n&7&lGlass Helmet, Chest, Legs and Boots!"
set loop-player on fire
#---------------------#
#--- k2 ---#
on player world change:
wait 2 seconds
player is in "k2":
remove slow falling from player
remove jump boost from player
remove wither effect from player
wait 1 seconds
apply potion of slow falling of tier 1 without any particles to the player for 1 day
apply potion of jump boost of tier 1 without any particles to the player for 1 day
every 5 seconds in world "k2":
loop all players in world "k2":
if loop-player doesn't have slow falling:
apply potion of slow falling of tier 1 without any particles to the loop-player for 1 day
if loop-player doesn't have jump boost:
apply potion of jump boost of tier 2 without any particles to the loop-player for 1 day
#----------------------#