I made a moderation-call system for my game, in case of any trollers,spammers and hackers.
local payload = httpsservice:JSONEncode({
content = plr.Name.." is asking a mod to join their server in game!",
username = "Game server"
})
local payload2 = httpsservice:JSONEncode({
content = "Reason for mod-call: "..secondinfo;
username = "Game server"
})
game.ReplicatedStorage.ModeratorCall:FireClient(player,number)
number = number + 1
wait(2)
httpsservice:PostAsync(webhook,payload)
httpsservice:PostAsync(webhook,payload2)
end)
Now I want to ping someone in discord, like (@Admins) someone is calling a mod.I am not able to ping them, if i send data like “plr is calling mod @admins” its just typing the text there
I want it to ping the role, any way to do this ping?
local payload = httpsservice:JSONEncode({
content = plr.Name.." is asking an admin to join their server in game! <@Administrator> ",
username = "Game server",
allowed_mentions = true
})
the full script check the else if script down, that is not working
local httpsservice = game:GetService("HttpService")
local number = 1
local webhook = "blah blah"
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local player = plr
local message = msg
local spiltedmessage = message:split(" ")
if string.lower(spiltedmessage[1]) == "!mod" then
local secondinfo = nil
wait(0.5)
if string.lower(spiltedmessage[2]) == "troller" or "hacker" or "spammer" or "bully" then
secondinfo = spiltedmessage[2]
else
secondinfo = "No reason mentioned"
end
-- Sending message
local payload = httpsservice:JSONEncode({
content = plr.Name.." is asking a mod to join their server in game!",
username = "Game server"
})
local payload2 = httpsservice:JSONEncode({
content = "Reason for mod-call: "..secondinfo;
username = "Game server"
})
game.ReplicatedStorage.ModeratorCall:FireClient(player,number)
number = number + 1
wait(2)
httpsservice:PostAsync(webhook,payload)
httpsservice:PostAsync(webhook,payload2)
elseif string.lower(spiltedmessage[1]) == "!admin" then
local secondinfo = plr.Name.." is calling an admin+ to join."
wait(0.5)
-- Sending message
local payload = httpsservice:JSONEncode({
content = plr.Name.." is asking an admin to join their server in game! <@Administrator> ",
username = "Game server",
allowed_mentions = true
})
local payload2 = httpsservice:JSONEncode({
content = "Reason for mod-call: "..secondinfo;
username = "Game server"
})
game.ReplicatedStorage.ModeratorCall:FireClient(player,number)
number = number + 1
wait(2)
httpsservice:PostAsync(webhook,payload)
httpsservice:PostAsync(webhook,payload2)
end
end)
end)