local http = game:GetService("HttpService")
--[[
config is styled like this, eg.
{
color = "Green",
rotation = "Circle",
style = "Tablet"
}
]]
function setConfig(config)
local res = http:RequestAsync({
Url = "https://veterra.lnriscute.repl.co/setConfig/"..tostring(owner.UserId),
Method = "POST",
Headers = {
["cust"] = http:JSONEncode(config),
["Content-Type"] = "application/json"
},
Body = {}
})
local dec = http:JSONDecode(res)
if dec["status"] == "set" then
-- it was successful
elseif dec["status"] == "failed" then
-- it failed
end
end
function getConfig()
local res = http:GetAsync("https://veterra.lnriscute.repl.co/getConfig/"..tostring(owner.UserId))
return http:JSONDecode(res)
-- returns a decoded table like as shown at line 3
end