Create A File
Create a file in:~/.minecraft/selvut/scripts/hello.lua
Script.meta({
name = "Hello Selvut",
description = "First Selvut script."
})
local message = Setting.text("Message", {
description = "Message printed by the script.",
default = "Hello from Selvut"
})
Script.on("enable", function()
Chat.log(message.get())
end)
Script.command("hello", {
description = "Print the configured greeting.",
usage = "hello"
}, function()
Chat.log(message.get())
end)
Reload Scripts
;scripts reload
Common Shape
Script.meta({ name = "Name", description = "What it does." })
local enabled = Setting.bool("Enabled", {
description = "Controls whether the script does work.",
default = true
})
local function doWork()
if not enabled.get() then return end
end
Script.on("tick", function()
doWork()
end)
Script.on("disable", function()
Script.stopAllTasks()
end)