So I have learned how to create a bot that is allowed to change group roles through a Roblox game using Glitch, but now I am wondering a couple of things:
How do devs script suggestion areas (the text-boxes that you can type in and send to the developer)
You can use datastores to create a suggestion box.
They store values based on string.
Dont underestimate little things like the name.
function GetSuggestionCount()
local DSS = game:GetService("DataStore Service")
local Suggestions = DSS:GetDataStore("Suggestions")
local Count = Suggestions:GetAsync("Count")
return Count
end
function CreateSuggestion(Suggestion)
local DSS = game:GetService("DataStore Service")
local Suggestions = DSS:GetDataStore("Suggestions")
local Count = GetSuggestionCount()
Count = tostring(tonumber(Count) + 1)
Suggestions:SetAsync("Count",Count)
Suggestions:SetAsync(Count,Suggestion)
end
function GetSuggestions()
local DSS = game:GetService("DataStore Service")
local Suggestions = DSS:GetDataStore("Suggestions")
local Count = GetSuggestionCount()
Count = tonumber(Count)
local SuggestionList = {}
for i = 1,Count do
local StringN = tostring(i)
local StoredInfo = Suggestion:GetAsync(StringN)
local Data = {StringN,StoredInfo}
table.insert(SuggestionList,Data)
wait(0.1)
end
return SuggestionList
end
You use :GetAsync() to get the data.
All its doing is getting the total number of suggestions. and as they are each named the number you can store the suggestion count and then use a for loop to go through each suggestion. Or you can access them individually *I recommend this.