endpoint
🌙 Lua Crescente+
Fires when an external application (Roblox, Minecraft, FiveM, a website, an API, etc.) makes an HTTP request to this file's Endpoint. The event parameter carries body, headers, query, method, ip, userAgent and timestamp, plus the event.status(code), event.header(key, value) and event.reply(data) methods to respond to the request. Premium feature, available from the Lua Crescente plan.
on endpoint(event) ... end
Parâmetros
| Nome |
|---|
| event |
Exemplo de uso
on endpoint(event)
let jogador = event.body.player
let nivel = event.body.level
print("Jogador:", jogador, "Nivel:", nivel)
event.status(200)
event.header("Content-Type", "application/json")
event.reply({ success: true, message: "Dados recebidos" })
end