Exemplos
Scripts de exemplo prontos para usar
Uma coleção de scripts de exemplo que você pode usar como base para seus próprios projetos.
Sistema de Home
home-system.lzl
# Sistema de Home Completo
# Permite players definirem e teleportarem para casa
command /sethome:
permission: player.home
trigger:
set {home::%player's uuid%} to player's location
send "&aHome set at your current location!" to player
command /home:
permission: player.home
cooldown: 5 seconds
cooldown message: "&cWait %remaining time% before teleporting again!"
trigger:
if {home::%player's uuid%} is set:
send "&eTeleporting home..." to player
wait 3 seconds
teleport player to {home::%player's uuid%}
send "&aTeleported home!" to player
else:
send "&cYou don't have a home set! Use /sethome" to player
command /delhome:
permission: player.home
trigger:
if {home::%player's uuid%} is set:
delete {home::%player's uuid%}
send "&aHome deleted!" to player
else:
send "&cYou don't have a home!" to playerSistema de Ranks
rank-system.lzl
# Sistema de Ranks com Chat Formatado
function get_prefix(player: player) returns text:
set {_rank} to {rank::%{player}'s uuid%} ? "member"
switch {_rank}:
case "owner":
return "&4[OWNER]"
case "admin":
return "&c[ADMIN]"
case "mod":
return "&e[MOD]"
case "vip":
return "&6[VIP]"
default:
return "&7[MEMBER]"
on join:
if {rank::%player's uuid%} is not set:
set {rank::%player's uuid%} to "member"
set {_prefix} to get_prefix(player)
broadcast "%{_prefix}% &f%player% &7joined the server!"
on quit:
set {_prefix} to get_prefix(player)
broadcast "%{_prefix}% &f%player% &7left the server."
on chat:
cancel event
set {_prefix} to get_prefix(player)
broadcast "%{_prefix}% &f%player%&7: &f%message%"
command /setrank <player> <text>:
permission: admin.rank
trigger:
set {_target} to arg-1 parsed as player
set {_rank} to arg-2
if {_rank} is not "owner" and {_rank} is not "admin" and {_rank} is not "mod" and {_rank} is not "vip" and {_rank} is not "member":
send "&cInvalid rank! Use: owner, admin, mod, vip, member" to player
stop
set {rank::%{_target}'s uuid%} to {_rank}
send "&aSet %{_target}%'s rank to %{_rank}%" to player
send "&aYour rank has been set to %{_rank}%!" to {_target}Sistema de Kit
kit-system.lzl
# Sistema de Kits com Cooldowns
command /kit starter:
permission: kit.starter
cooldown: 24 hours
cooldown message: "&cYou can claim this kit again in %remaining time%!"
trigger:
give 1 iron_sword to player
give 1 iron_pickaxe to player
give 1 iron_axe to player
give 32 steak to player
give 16 torch to player
send "&aStarter kit received!" to player
send title "&aKit Received!" with subtitle "&7Starter Kit" to player
command /kit vip:
permission: kit.vip
cooldown: 12 hours
cooldown message: "&cYou can claim this kit again in %remaining time%!"
trigger:
give 1 diamond_sword with sharpness 3 to player
give 1 diamond_pickaxe with efficiency 3 to player
give 64 golden_apple to player
apply speed 2 to player for 10 minutes
apply resistance 1 to player for 10 minutes
send "&6VIP kit received!" to player
send title "&6VIP Kit" with subtitle "&eEnjoy your perks!" to player
command /kit pvp:
permission: kit.pvp
cooldown: 1 hour
trigger:
give 1 diamond_sword with sharpness 5 to player
give 1 diamond_helmet with protection 4 to player
give 1 diamond_chestplate with protection 4 to player
give 1 diamond_leggings with protection 4 to player
give 1 diamond_boots with protection 4 to player
give 16 golden_apple to player
send "&cPvP kit received! Good luck!" to playerSistema de Economia
economy-system.lzl
# Sistema de Economia Básico
on first join:
set {balance::%player's uuid%} to 100
send "&aYou received 100 coins as a welcome bonus!" to player
command /balance:
aliases: /bal, /money
trigger:
set {_bal} to {balance::%player's uuid%} ? 0
send "&eYour balance: &f%{_bal}% coins" to player
command /pay <player> <number>:
trigger:
set {_target} to arg-1 parsed as player
set {_amount} to arg-2
if {_amount} <= 0:
send "&cAmount must be positive!" to player
stop
if {_target} is player:
send "&cYou can't pay yourself!" to player
stop
set {_balance} to {balance::%player's uuid%} ? 0
if {_balance} < {_amount}:
send "&cInsufficient funds! You have %{_balance}% coins." to player
stop
remove {_amount} from {balance::%player's uuid%}
add {_amount} to {balance::%{_target}'s uuid%}
send "&aSent %{_amount}% coins to %{_target}%!" to player
send "&a%player% sent you %{_amount}% coins!" to {_target}
command /baltop:
trigger:
send "&6=== Top 10 Richest Players ===" to player
# Implementação simplificada
send "&7Use /balance to check your balance" to playerSistema de Warp
warp-system.lzl
# Sistema de Warps
command /setwarp <text>:
permission: admin.warp
trigger:
set {_name} to arg-1
set {warp::%{_name}%} to player's location
add {_name} to {warps::*}
send "&aWarp '%{_name}%' created!" to player
command /warp <text>:
trigger:
set {_name} to arg-1
if {warp::%{_name}%} is set:
send "&eTeleporting to %{_name}%..." to player
wait 2 seconds
teleport player to {warp::%{_name}%}
send "&aArrived at %{_name}%!" to player
else:
send "&cWarp '%{_name}%' not found!" to player
command /delwarp <text>:
permission: admin.warp
trigger:
set {_name} to arg-1
if {warp::%{_name}%} is set:
delete {warp::%{_name}%}
remove {_name} from {warps::*}
send "&aWarp '%{_name}%' deleted!" to player
else:
send "&cWarp '%{_name}%' not found!" to player
command /warps:
trigger:
if {warps::*} is empty:
send "&cNo warps available!" to player
stop
send "&6=== Available Warps ===" to player
loop {warps::*}:
send "&7- &f%loop-value%" to playerAnti-Spam
anti-spam.lzl
# Sistema Anti-Spam com Event Streams
stream "chat_spam":
collect: player_chat
group by: player
window: 5 seconds
trigger when: count >= 4
then:
cancel event
send "&cSlow down! You're sending messages too fast." to player
add 1 to {spam_warnings::%player's uuid%}
if {spam_warnings::%player's uuid%} >= 3:
execute console command "kick %player% Spam warning limit reached"
stream "command_spam":
collect: player_command
group by: player
window: 3 seconds
trigger when: count >= 5
then:
send "&cYou're using commands too fast!" to player
# Reset warnings diário
every day at 00:00:
delete {spam_warnings::*}Dica
Use estes exemplos como ponto de partida. Modifique e combine-os para criar sistemas únicos para seu servidor!