If you want to use the HuskAPI to kick users who are flagged, you can implement the following kick script in your Roblox game.
Lua Kick Script:
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
-- API endpoint
local API_URL = "https://husk-api.onrender.com/items"
-- Function to check if userID exists in the API DB
local function shouldKickUser(userId)
local success, response = pcall(function()
local payload = HttpService:JSONEncode({id = tostring(userId)})
local headers = {["Content-Type"] = "application/json"}
local res = HttpService:PostAsync(API_URL, payload, Enum.HttpContentType.ApplicationJson, false, headers)
-- API returns JSON boolean true/false
return HttpService:JSONDecode(res)
end)
if success then
return response == true
else
warn("Failed to call API for user:", userId, response)
return false
end
end
-- Connect player added event
Players.PlayerAdded:Connect(function(player)
-- Check if player should be kicked
if shouldKickUser(player.UserId) then
player:Kick("You have been kicked for being on the HUSK database, please go to huskapi.neocities.org")
end
end)
For more information, contact me at guyt6516@gmail.com