Modcall History doesn't works properly

Hello!
I made a modcall history system, which works if a person modcalls, that modcall will be shown in history to all mods, but I got a problem.

afl


In this picture show how i modcalled, but nothing appeared.

Two people mod called, but nothing is shown for me and moderators.

Why do you need to do this? Couldn’t you send a HTTP Request to a discord webhook and have all the details in there you could put ;

  1. Mod needed reason
  2. Time they where called
  3. Username

And then the person could see the mod call / or report VIA webhook, and evidence can be provided there, then the player can be kicked/or banned. If you don’t like this method, let me know. I can try writing up a solution with your current method.

2 Likes

I use webhook for panel actions.
I really wanna use it without HTTP

Couldn’t you send the JobId to the webhook, and then the mod who is going to accept it will join a server, they have a panel, and paste the job ID in there, and it does the same thing.
When the report is sent it would send game.JobId and the report reason + the player name and time created. After that everything would be separated in the webhook to keep clean organization, the mod who accepts it would then join the server, and paste the JobID.

Nononon, i wanna use that one i made. Cause… is cool xd

But if the webhook system works, why use your current system? Nothing seems wrong currently with the system.

Also try this instead of what you currently have ;


function MakeModcall(plr, msg) --All you need is plr and msg, remove the rest. A player could fire the server with a different placeId and JobId and "troll" the mod
	for _,v in pairs(game.Players:GetPlayers()) do
		if moderators[v.UserId] ~= nil or moderators[v.Name] ~= nil then
			local modcall = script.ModCall:Clone()
			modcall.Parent = v.PlayerGui.ModcallHistory.Frame
			modcall.PlaceId.Value = game.PlaceId
			modcall.JobId.Value = game.JobId
			modcall.Username.Text = plr.Name
			modcall.Comments.TextLabel.Text = msg
			break
		end
	end
end

No, PlaceId and JobId are necessary cause person who modcalled can be from different server.

You could get your account terminated on Discord if you abuse webhooks for actions like this.

1 Like

Is the ModcallHistory ScreenGui located in StarterGui? If so, then the
modcall.Parent = v.PlayerGui.ModcallHistory.Frame
part is wrong. The reason behind this is because the client loads the GUIs in PlayerGui, not the server, so the server can’t read any GUIs in the PlayerGui, causing it to error.

Nevermind, the reason above isn’t the reason.

If it’s not that, then moving modcall.Parent = v.PlayerGui.ModcallHistory.Frame to above break should do the trick. The reason why we should do this is because the LocalScript may just instantly check the values of PlaceId and JobId once, even if it changes.
local moderators = require(game:GetService(“ServerStorage”):WaitForChild(“Moderators”))

local tpservice = game:GetService("TeleportService")

local event = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage").RemoteEvents:WaitForChild("Modcall"))
event.Name = "History"

function MakeModcall(plr, msg, placeId, jobId)
	for _,v in pairs(game.Players:GetPlayers()) do
		if moderators[v.UserId] or moderators[v.Name] then
			local modcall = script.ModCall:Clone()
			modcall.PlaceId.Value = placeId
			modcall.JobId.Value = jobId
			modcall.Username.Text = plr.Name
			modcall.Comments.TextLabel.Text = msg
			modcall.Parent = v.PlayerGui.ModcallHistory.Frame
		end
	end
end

function AcceptModcall(plr, placeId, jobId)
	tpservice:TeleportToPlaceInstance(placeId, jobId, plr)
end

game.Players.PlayerAdded:Connect(function(plr)
	if moderators[plr.UserId] or moderators[plr.Name] then
		if not plr.PlayerGui:FindFirstChild("ModcallHistory") then
			script.ModcallHistory:Clone().Parent = plr.PlayerGui
		end
	end
end)

event.OnServerEvent:Connect(function(plr, cmd, text, placeId, jobId, modcaller)
	if cmd == "Make" then
		MakeModcall(modcaller, text, placeId, jobId)
	elseif  cmd  == "Accept" then
		AcceptModcall(plr, placeId, jobId)
	end
end)

What do you mean?
I made only mod panel actions shown in discord, for safer if mod abuse I will know.

Oh yea one thing.
If 2 mods are in game, then 2 times this gets sent.

Do you mean:

  • They get the request sent 2 times to each individual mod
  • It gets sent two times, but it’s split apart to the mods, so one for the 1st mod, one for the 2nd mod

Uh how to explain but.
It’s like me and a mod
Someone modcalls, and if in server are 3 mods then every mod gets 3 same requests in history.

Basically, if you spam Discord requests (for example, randomly your game gets super popular and you are rolling out a ton of bans since you found out a ton of people broke the rules) then it will spam the Discord webhooks. Discord doesn’t allow overuse of their system and you can risk your Discord account getting terminated.

1 Like

Yea i know, but webhook sends only : ban, unban, game shutdown actions, nothing else.

By the way, i didnt sent this:

function MakeModcall(player, message)
	local t = {}
	t.Creator = player.Name
	t.CreatorId = player.UserId
	t.Comment = game:GetService("Chat"):FilterStringForBroadcast(message, player)
	t.PlaceId = game.PlaceId
	t.JobId = game.JobId
	for _,v in pairs(game.Players:GetPlayers()) do
		if moderators[v.UserId] ~= nil or moderators[v.Name] ~= nil then
			modcall_data:FireClient(v, t.Comment, t.PlaceId, t.JobId, player)
			break
		end
	end
	game:GetService("MessagingService"):PublishAsync("Modcall", httpService:JSONEncode(t))
end

This sends a request to modcall history.

Problem may be here.

That’s the reason why! It actually sends two modcalls instead of one by sending it from MessagingService, and sending from the server itself.

local tpservice = game:GetService("TeleportService")

local event = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage").RemoteEvents:WaitForChild("Modcall"))
event.Name = "History"

function MakeModcall(data)
    data = game:GetService("HttpService"):JSONDecode(data["Data"])
    local plr = game.Players:GetPlayerByUserId(data.CreatorId)
    local msg = data.Comment
    local placeId = data.PlaceId
    local jobId = data.JobId
	for _,v in pairs(game.Players:GetPlayers()) do
		if moderators[v.UserId] or moderators[v.Name] then
			local modcall = script.ModCall:Clone()
			modcall.PlaceId.Value = placeId
			modcall.JobId.Value = jobId
			modcall.Username.Text = data.Creator
			modcall.Comments.TextLabel.Text = msg
			modcall.Parent = v.PlayerGui.ModcallHistory.Frame
		end
	end
end

game:GetService("MessagingService"):SubscribeAsync("Modcall", MakeModcall)

function AcceptModcall(plr, placeId, jobId)
	tpservice:TeleportToPlaceInstance(placeId, jobId, plr)
end

game.Players.PlayerAdded:Connect(function(plr)
	if moderators[plr.UserId] or moderators[plr.Name] then
		if not plr.PlayerGui:FindFirstChild("ModcallHistory") then
			script.ModcallHistory:Clone().Parent = plr.PlayerGui
		end
	end
end)

event.OnServerEvent:Connect(function(plr, cmd, text, placeId, jobId, modcaller)
	if cmd == "Make" then
        local t = {}
t.Creator = plr.Name
t.CreatorId = plr.UserId
t.Comment = game:GetService("Chat"):FilterStringForBroadcast(text, plr)
t.PlaceId = game.PlaceId
t.JobId = game.JobId
game:GetService("MessagingService"):PublishAsync("Modcall",httpService:JSONEncode(t))
		MakeModcall(plr, text, placeId, jobId)
	elseif  cmd  == "Accept" then
		AcceptModcall(plr, placeId, jobId)
	end
end)

You’re doing wrong that what i sent was a modcall system script, not modcall history

Is there anything related to MessagingService in the ModcallHistory script?

No only this!!!