Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I don't know how to start understanding how to create a Feed back gui?

So I want to make a feed back gui/ui but I don't know how. I have heard other people say you can use HttpService or DataStore but I am not sure. I am not good with Data Store and have no experience with HttpService. I don't want you to write a whole script that would be way to time consuming.

Thanks for any help given!

1 answer

✓ Accepted answer

I know you said not to write a whole script but... I just had to

You don't have to copy/paste this as it is, but you can use it to better understand how it works

Server:

local DataStore = game:GetService("DataStoreService"):GetDataStore("SomeData")

local dsKey = "Feedback!@#$%"

local feedbackEvent = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
feedbackEvent.Name = "feedbackEvent"

local feedbackDebounce = {} --only once per join to prevent spam :?

feedbackEvent.OnServerEvent:Connect(function(plr, msg)
	if feedbackDebounce[plr.Name] then
		return
	end
	feedbackDebounce[plr.Name] = true
	DataStore:UpdateAsync(dsKey, function(data)
		local data = data or {}
		data[#data + 1] = plr.Name .. ": " .. msg
		return data
	end)
end)

game:GetService("Players").PlayerRemoving:Connect(function(plr)
	feedbackDebounce[plr.Name] = nil
end)

game:GetService("Players").PlayerAdded:Connect(function(plr)
	if plr.UserId == game.CreatorId then --assuming this isn't a group place
		plr.Chatted:Connect(function(m)
			if #m >6 and m:sub(1,6) == "/view " and tonumber(m:sub(7)) ~= nil then
				-- usage: /view <amount> i.e. /view 2
				local toShow = {}
				local limit = tonumber(m:sub(7))
				DataStore:UpdateAsync(function(data)
					limit = limit <= #data and limit or #data
					for i=0,limit do
						toShow[#toShow + 1] = data[1]
						table.remove(data, 1)
					end
					feedbackEvent:FireClient(plr, "Print", toShow) --pass the toShow table to the client
					return data
				end)
			end
		end)
	end
end)

Client:

local textBox = script.Parent.TextBox
local button = script.Parent.Button

local feedbackEvent = game:GetService("ReplicatedStorage"):WaitForChild("feedbackEvent")

button.MouseButton1Click:Connect(function()
	feedbackEvent:FireServer(textBox.Text)
end)

feedbackEvent.OnClientEvent:Connect(function(cmd, arg)
	if cmd == "Print" then
		print(table.concat(arg, "\n")) --print the toShow table
	end
end)

2 comments

0

Untested btw

0

Thanks for this! I will see if this works!

This discussion is preserved as it was. New answers, comments, and votes are closed.