Hello everyone how are you?
--// Services
local HttpService = game:GetService("HttpService");
local RocketBots = {}
RocketBots.__index = RocketBots;
--// Creates a bot object
function RocketBots.new(loaderId)
local BotObject = setmetatable({}, RocketBots);
BotObject.id = loaderId
return BotObject
end
--// Enviornment
local apiBase = "https://roblox-rocketapps.bloxtech.tech/roblox/bots"
local function http(loaderId, endpoint, method, body)
if (body) then
body = HttpService:JSONEncode(body)
end
local success, message = pcall(function()
local newURL = apiBase .. '/' .. loaderId .. endpoint
local Response = HttpService:RequestAsync({
Url = newURL,
Method = method,
Headers = {
["Content-Type"] = "application/json" -- When sending JSON, set this!
},
Body = body
});
return HttpService:JSONDecode(Response.Body)
end)
if (not success) then
return {success = false, response = message}
else
return message;
end
end
--// Functions for the bot object.
function RocketBots:GetInfo()
return http(self.id, '/', 'GET')
end
function RocketBots:GetJoinRequests()
return http(self.id, '/getjoinrequests', 'GET')
end
function RocketBots:Shout(message)
return http(self.id, '/shout', 'POST', {msg = message})
end
function RocketBots:MessageUser(userId: string, subject: string, message: string)
return http(self.id, '/messageuser', 'POST', { ["userId"] = userId, ["subject"] = subject, ["message"] = message })
end
function RocketBots:ApproveJoinRequest(userId: string)
return http(self.id, '/approvejoinrequest', 'POST', { ["userId"] = userId })
end
function RocketBots:DeclineJoinRequest(userId: string)
return http(self.id, '/declinejoinrequest', 'POST', { ["userId"] = userId })
end
function RocketBots:RankInGroup(userId: string, rank: string)
return http(self.id, '/rankingroup', 'POST', { ["userId"] = userId, ["rankId"] = rank })
end
function RocketBots:Exile(userId: string)
return http(self.id, '/exile', 'POST', { ["userId"] = userId})
end
return RocketBots
How do I use this script its a module script so do I put it inside a normal script? also what would i put in the normal script to change the rank?
I am making it so that once a player says /role (rolenumber) then it changes their role. I think I may be able to make the chat script but if anyone has any tips please reply with it such as how i would get player id from which player said it.