- Katılım
- 5 Mart 2019
- Mesajlar
- 104
- Elmaslar
- 12
- Puanlar
- 0
- Yaş
- 24
- Minecraft
- AliHD_YT
Oyunda çok kişi olduğunda lag yapabilir. Altını çiziyorum, çok kişi olduğunda...
Kod:on any movement: if player is in "cakmalobi": cancel event
Bu kod sağlıklı bir kod değil.JavaScript:on any movement: if player's world is "cakmalobi": cancel event
# Development by L1T3R4L
on join:
if {lastLocation::%player%} isn't set:
set {lastLocation::%player%} to player's location
on any movement:
set {_loc} to player's location
if player is in "cakmalobi":
set {_x::*} to split "%{_loc}'s x coord%" at "."
set {_y::*} to split "%{_loc}'s y coord%" at "."
set {_z::*} to split "%{_loc}'s z coord%" at "."
set {_x} to {_x::1} parsed as int
set {_y} to {_y::1} parsed as int
set {_z} to {_z::1} parsed as int
set {_lx::*} to split "%{lastLocation::%player%}'s x coord%" at "."
set {_ly::*} to split "%{lastLocation::%player%}'s y coord%" at "."
set {_lz::*} to split "%{lastLocation::%player%}'s z coord%" at "."
set {_lx} to {_lx::1} parsed as int
set {_ly} to {_ly::1} parsed as int
set {_lz} to {_lz::1} parsed as int
set {isMoved} to false
if {_x} is more than or less than {_lx}:
set {isMoved} to true
else if {_y} is more than or less than {_ly}:
set {isMoved} to true
else if {_z} is more than or less than {_lz}:
set {isMoved} to true
if {isMoved} is true:
cancel event
set {lastLocation::%player%} to {_loc}
çok fazla satırdan dolayı lag yapabilirde gereksiz ve çok uzun biraz kısaltılamazmı ?Bu kod sağlıklı bir kod değil.
Çünkü oyuncu yürümese sadece fareyi döndürse bu event çalışacak, bu event bir çok oyuncu tarafından tetikleneceği için sunucuya yük bindirecektir.
Benim kodum daha sağlıklı çalışacaktır.
Kod:# Development by L1T3R4L on join: if {lastLocation::%player%} isn't set: set {lastLocation::%player%} to player's location on any movement: set {_loc} to player's location if player is in "cakmalobi": set {_x::*} to split "%{_loc}'s x coord%" at "." set {_y::*} to split "%{_loc}'s y coord%" at "." set {_z::*} to split "%{_loc}'s z coord%" at "." set {_x} to {_x::1} parsed as int set {_y} to {_y::1} parsed as int set {_z} to {_z::1} parsed as int set {_lx::*} to split "%{lastLocation::%player%}'s x coord%" at "." set {_ly::*} to split "%{lastLocation::%player%}'s y coord%" at "." set {_lz::*} to split "%{lastLocation::%player%}'s z coord%" at "." set {_lx} to {_lx::1} parsed as int set {_ly} to {_ly::1} parsed as int set {_lz} to {_lz::1} parsed as int set {isMoved} to false if {_x} is more than or less than {_lx}: set {isMoved} to true else if {_y} is more than or less than {_ly}: set {isMoved} to true else if {_z} is more than or less than {_lz}: set {isMoved} to true if {isMoved} is true: cancel event set {lastLocation::%player%} to {_loc}
Satır sayısı = lag - Böyle bir şey yokçok fazla satırdan dolayı lag yapabilirde gereksiz ve çok uzun biraz kısaltılamazmı ?
satır sayısı ile alakası olduğunu sanmıyorumçok fazla satırdan dolayı lag yapabilirde gereksiz ve çok uzun biraz kısaltılamazmı ?
Bu kod sağlıklı bir kod değil.
Çünkü oyuncu yürümese sadece fareyi döndürse bu event çalışacak, bu event bir çok oyuncu tarafından tetikleneceği için sunucuya yük bindirecektir.
Benim kodum daha sağlıklı çalışacaktır.
Kod:# Development by L1T3R4L on join: if {lastLocation::%player%} isn't set: set {lastLocation::%player%} to player's location on any movement: set {_loc} to player's location if player is in "cakmalobi": set {_x::*} to split "%{_loc}'s x coord%" at "." set {_y::*} to split "%{_loc}'s y coord%" at "." set {_z::*} to split "%{_loc}'s z coord%" at "." set {_x} to {_x::1} parsed as int set {_y} to {_y::1} parsed as int set {_z} to {_z::1} parsed as int set {_lx::*} to split "%{lastLocation::%player%}'s x coord%" at "." set {_ly::*} to split "%{lastLocation::%player%}'s y coord%" at "." set {_lz::*} to split "%{lastLocation::%player%}'s z coord%" at "." set {_lx} to {_lx::1} parsed as int set {_ly} to {_ly::1} parsed as int set {_lz} to {_lz::1} parsed as int set {isMoved} to false if {_x} is more than or less than {_lx}: set {isMoved} to true else if {_y} is more than or less than {_ly}: set {isMoved} to true else if {_z} is more than or less than {_lz}: set {isMoved} to true if {isMoved} is true: cancel event set {lastLocation::%player%} to {_loc}
on any move:
if world is in "cakmalobi":
set walk speed to 0
on player world change:
if world of player is "world":
remove 1 potion from player