I'm thinking about having a bug reporting feature for a game I'm working on. Where you can type whatever bug you encounter in the game and submit it for me to view. However, I have no idea how to go about sending the bug to me, so how would I go about doing that?
Thanks! :^)
Hi dylan,
I'll post the data store script below but, I advise checking out that game and seeing all my scripts with the whole hierarchy there, it's much more efficient.
local ds = game:GetService("DataStoreService"):GetDataStore("Bug Reports"); local players = game:GetService("Players"); local rs = game:GetService("ReplicatedStorage"); local add_ev = rs:WaitForChild("Add Bug"); local key = "Bug Reports" local admins = { ["KingLoneCat"] = true; ["dylan5225"] = true; } players.PlayerAdded:Connect(function(plr) if admins[plr.Name] then plr.Chatted:Connect(function(msg) if msg == "#bugs" then local bugs = ds:GetAsync(key); if bugs then for _, bug in next, bugs do print(bug); end end end end) end end) function add_bug(plr, str) local vals_already_there = ds:GetAsync(key); local data_to_save; if vals_already_there then vals_already_there[#vals_already_there + 1] = str; data_to_save = vals_already_there; else data_to_save = {str}; end ds:SetAsync(key, data_to_save) end add_ev.OnServerEvent:Connect(add_bug);
Thanks,
Best regards,
~~ KingLoneCat