Help with reports system

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    im trying to get the required data properly

  2. What is the issue? Include screenshots / videos if possible!
    im trying to print the victims (person being reported) name, instead it prints/returns

08:46:01.198 ▼ {
[“Data”] = “test”,
[“Sent”] = 1721310359.163
} - Server - Reports:11

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ive tried messing with how the values are given, but im not sure what to do since im new to using messageservice

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

the code below is what handles the information, the code ran to trigger it will be below

local messageservice = game:GetService("MessagingService")

messageservice:SubscribeAsync("report",function(victim,reporter,reason)
	local module = require(game.ServerScriptService.ReportsSave.ModuleScript)
	
	print(victim)
	module.reports[victim] = victim --{reporter,reason}
	module.reports[victim].Reporter = reporter
	module.reports[victim].Reason = reason
	task.wait(2)
	print(module.reports[victim])

	
end)

trigger:

local messageservice = game:GetService("MessagingService")

messageservice:PublishAsync("report","victimname","reportername","reason")

basiclly what im trying to do is make a report system where my admins can report certain people and a menu will appear with all currently reported/on watch people are, and what the reason is

right now im just trying to save

  1. the reporter
  2. the reason

within a value of the vicitims name

(the report info will be saved inside a module table)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

If any more information is required, ask and i will happily answer

AND
if you think that theres a better way to do this, please do inform me as i want the best possible experience with this menu

1 Like

When you are using PublishAsync, you have to send the data via a table.
After you send the data via a table, you can then get the data by indexing for “Data” in your table (in this case, your “victim” table).

i figured this out on my own time, but thank you for the help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.