Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Securing ChatService to prevent exploiters from executing?

Asked by 5 years ago

Alright guys, mayor issue here;

For one of my announcement scripts I'm using a ChatService function to see if a user is a certain rank in my group, or if his name is on the whitelist. I'm unsure if my system is protected against exploiters who might abuse it, so I'm asking for any advice if there is any.

My script:

local prefix = "-ann "

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        if plr:GetRankInGroup(123456) >= 100 or plr.Name == "RegisteredCode" then
            if string.sub(msg, 1, 5) == prefix then
                local ann = string.sub(msg, 6);
                for i,v in pairs (game.Players:GetPlayers()) do
                    local gui = script.messageGui:Clone();
                    gui.Parent = v.PlayerGui;
                    gui.msg.TextLabel.Text = ann;
                end
                    wait(6)
                for i,v in pairs (game.Players:GetPlayers()) do
                    v.PlayerGui.messageGui:Destroy();
                end
            end
        end
    end)
end)

Some might see several issues already, perhaps by the way I format my code or using double for loops. Any suggestions are more than welcome.

Cheers!

0
If the script containing the code is a server script, the client can't do anything. EpicMetatableMoment 1444 — 5y
0
It is in fact a server script, so this would mean my announcements are secure and can in no way be fired by random players? User#20989 0 — 5y
0
Yes EpicMetatableMoment 1444 — 5y
0
Awesome, thanks User#20989 0 — 5y

Answer this question