Çözüldü Belirli bir dünyada Oyuncu Hareket Ettirmeme

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Türk_Craft

Bir Kömür Göründü Kaptanım!
Katılım
5 Mart 2019
Mesajlar
104
Elmaslar
12
Puan
0
Yaş
26
Minecraft
AliHD_YT

Discord:

AliHD#4006

ARKADAŞLAR SİZLERDEN BİR RİCAM OLACAK, ŞÖYLE BİR SKRİPT İSTİYORUM 'cakmalobi' dünyasında oyuncular oyuna girdiklerinde cakmalobi dünyasında belirlediğim alanda doğacaklar, ve hareket edemeyecekler.
 
JavaScript:
on any movement:
    if player's world is "cakmalobi":
    cancel event
 
Sorun çözüldüyse belirtin.
 
Maalesef sadece cakmalobi dünyasında değil tüm dünyalarda çalışıyor
 
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
 
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

heeeeeeeeeeeeeeeeeeeeee güzel
 
JavaScript:
on any movement:
    if player's world is "cakmalobi":
    cancel event
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}
 
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}
çok fazla satırdan dolayı lag yapabilirde gereksiz ve çok uzun biraz kısaltılamazmı ?
 
çakmalobide oyuncuyu duraklatıcaksan oyuncuya giriş yaptığında madenci yorgunluğu 100 verirsen hareket edemez sorun çözülür bunun için skript yapmak daha mantıklı.
 
çok fazla satırdan dolayı lag yapabilirde gereksiz ve çok uzun biraz kısaltılamazmı ?
Satır sayısı = lag - Böyle bir şey yok
Önemli olan bir kodun işlemci ve rama ne kadar yük bindirdiğidir.
 
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}

Variable çöplüğü. Böyle birşey için bu çöplüğü yapmaya gerek yok.
 
skript-mirror lazım tabi bunu kullanmak için.

Kod:
import:
    org.bukkit.event.player.PlayerMoveEvent
on PlayerMoveEvent:
    world is "world":
    send "yürümesene .s" to event.getPlayer()
    event.setCancelled(true)
 
Onun yerine doğacağı yere görünmez blok koy olur biter. :'D Zaten macera modunda olunca fark edemezler. Eğer ille de skript istiyorum diyorsan, buyur:

Kod:
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

Denemedim ama hata yok.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl
Üst