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

Admin Scripts

Asked by 11 years ago

When I make admins scripts, I start them like this but it doesn't work right. If I were to add an FF command and say it, it would give everyone a FF in the server. Even If I say something like ff/Jacobrw01. I don't know why. Here is how I start though;

01local admins = {
02["Jacobrw01"] = true;
03["nws18"] = true;
04["JEFFREY0770"] = true;
05}
06 
07game.Players.PlayerAdded:connect(function(plr)
08if admins[plr.Name] then
09plr.Chatted:connect(function(m)
10if m:sub(1,5)=="kill/" then
11m:sub(1,6)
12for i,v in pairs(game.Players:GetChildren()) do
13v.Character:BreakJoints()
14end
15end
16end)
17end
18end)

This is roughly how I set it up on all my commands.

1 answer

Log in to vote
5
Answered by
Azarth 3141 Moderation Voter Community Moderator
11 years ago
01local admins = {
02["Jacobrw01"] = true;
03["nws18"] = true;
04["JEFFREY0770"] = true;
05}
06 
07local function findPlayer(msg,findName)
08    local seperate = msg:lower():sub(findName)
09    for a,b in pairs(game.Players:GetPlayers()) do
10        if string.find(b.Name:lower(), seperate) then
11            return b
12        end
13    end
14    return false
15end
View all 34 lines...
0
h                                                                                                                                                                                                                                                                                                                                                                                                                testthrow 0 — 6y
Ad

Answer this question