#Bad performance?

1 messages · Page 1 of 1 (latest)

royal lava
orchid canopy
#

what the-

#
  1. Line 8: This is a global variable that is being affected by all players. It does not seem to be used. Delete this line and variable.
  2. Line 9: Setting a variable to false means the variable is still set, so it takes up storage space. instead of having true/false; use true/not set
  3. Lines 12-13: are useless, that code is already run in the on join: event
  • again, the cosm_engineSound variable is taking up storage space. You can just checki if (the variable) is not set and then play the default sound
  1. line 16: please please please use any boat
  2. line 20: delete the variable to save storage space. Or just use a metadata tag
  3. do not loop all players so often. that is very inefficient. You can just use a while loop under your on vehicle enter: event.
  • all the variables in here should most definitely be local.
  • also, line 38 does not use {_speed}, but all the others do. You'll also have to define this local variable somewhere
rain cedar
#

the massive IF-chain is probably the main performance issue

orchid canopy
orchid canopy
rain cedar
#

it would also create a scheduler for each player running every tick

#

20 schedulers running tasks and skript/bukkit controling them is slower than just having 1 controlling them all.