I created a custom mute system, and when a player is muted, it's all good as he gets unmuted after the mute time has passed, but if he reconnects, he's no more muted and can still talk, whereas the script thinks he is muted and attempts to unmute an already unmuted player.
I tried using setElementData and getElementData when a muted player quits and then joins before the mute time has passed, but it didn't work out so I've no idea now. (Not included in the code below).
Have a look at the code. Any help regarding this will be appreciated.
if reason == "1" then
if isPlayerMuted(target) then return outputChatBox("Player is already muted.", player, 255, 0, 0) end
setPlayerMuted(target, true)
outputChatBox("* "..name.." has been muted by "..plrname.."!", root, 13, 107, 39, true)
setTimer(function()
setPlayerMuted(target, false)
outputChatBox("* "..name.." has been unmuted by Console.", root, 13, 107, 39, true)
end, 30000, 1)
end
Thanks.