Hello,
I’m making a moderation panel. What I want to do is disable the chat option for a specific player (so mute him).
I’ve tested it for myself, and it works perfectly. Except that I brought a double account, except that it doesn’t do anything, that’s the problem.
Here’s more information about my panel and scripts.
Button script :
local verifRemote = game.ReplicatedStorage.ModPanelV2.RemoteFunction.VerificationBAN
local muteBindable = game.ReplicatedStorage.ModPanelV2.BindableEvent.Mute
local btn = script.Parent.MuteButton
local targetPlayerId = btn.Parent.Parent.Sanctions.Identifiant
local demutebtn = script.Parent.DemuteButton
local pseudoTarget = btn.Parent.Parent.Sanctions.NameJoueur
local pseudoText = script.Parent.TargetPlayer
local idTarget = btn.Parent.Parent.Sanctions.Identifiant
local raisonText = script.Parent.Raison
local BindableEvent = game.ReplicatedStorage.ModPanelV2.BindableEvent:WaitForChild("EnvoieInfosSanction")
btn.Activated:Connect(function()
local autorise = verifRemote:InvokeServer()
if autorise then
muteBindable:Fire(tonumber(idTarget.Text), "Mute")
end
end)
demutebtn.Activated:Connect(function()
local autorise = verifRemote:InvokeServer()
if autorise then
muteBindable:Fire(tonumber(idTarget.Text), "Demute")
end
end)
BindableEvent.Event:Connect(function()
pseudoText.Text = "Joueur : " .. pseudoTarget.Text
task.wait(1)
pseudoText.Text = "Joueur : ".. pseudoTarget.Text
end)
Mute script :
local muteBindable = game.ReplicatedStorage.ModPanelV2.BindableEvent.Mute
local Players = game:GetService("Players")
local localplayer = game.Players.LocalPlayer
local function GetPlayer(identifiant)
for i, player in pairs(Players:GetPlayers()) do
if player.UserId == identifiant then
return player
end
end
end
muteBindable.Event:Connect(function(identifiant, action)
local joueur = GetPlayer(identifiant)
if joueur then
if localplayer.UserId == joueur.UserId then
local starterGui = game:GetService("StarterGui")
if action == "Mute" then
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
elseif action == "Demute" then
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end
end
end
end)
The script doesn’t work on my dual account, but it does work on mine.
Thanks !