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

I made a admin script and commands dosent work Can any of you help me?

Asked by 7 years ago

I made a admin script and it looks like that Any of the commands work :( So can somebody help me ? i'm a poor guy

-- This is a ALPHA version from EFFECTadmin
-- Hope you enjoy


local Admins = {"TITOticktickmanbaby","sneakysomboo2"}
local Prefix = "!"
-- ShutDown i guess
for i,v in pairs(Admins) do
    game.Players(Admins[i].Chatted:connect(function(msg)
        if msg:lower() == Prefix .. "killserver" then
            game.Players:ClearAllChildren()
            game.Workspace:ClearAllChildren()
-- Let it grow.
            for i,v in pairs(Admins) do
    game.Players(Admins[i].Chatted:connect(function(msg)
        if msg:lower() == Prefix .. "letitgrow" then
            local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=389394804"
sound.Parent = game.Workspace.MusicBlock
-- Bleach Yourself
for i,v in pairs(Admins) do
    game.Players(Admins[i].Chatted:connect(function(msg)
        if msg:lower() == Prefix .. "bleachlocal" then
            print("Do ya need a bleach?")
STOP = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
STOP.SoundId = "http://roblox.com/asset?id=356970690"
STOP.Looped = true
STOP:Play()
STOP.Volume = 2
plr = game.Players.LocalPlayer
char = plr.Character
mouse = plr:GetMouse()
local cough = Instance.new("Sound", workspace)
cough.SoundId = "http://roblox.com/asset?id=178522287"
Bleach = Instance.new("Part", char["Left Arm"])
Bleach.CanCollide = false
Mesh = Instance.new("SpecialMesh", Bleach)
Mesh.MeshId = "http://roblox.com/asset?id=483388971"
Mesh.Scale = Vector3.new(0.005, 0.005, 0.005)
Mesh.TextureId = "http://roblox.com/asset?id=520016684"
Handy = Instance.new("Weld", Bleach)
Handy.Part0 = Bleach
Handy.Part1 = char["Left Arm"]
Handy.C0 = CFrame.new(0.5,1.8,0)
Handy.C1 = CFrame.Angles(0,4,1)
drink = Instance.new("Sound", char.Head)
drink.SoundId = "http://roblox.com/asset?id=10722059"
function cringe(key)
    key = key:lower()
    if key == "q" then
        game.Chat:Chat(char.Head,"This is too cringe","Blue")
        wait(2)
        game.Chat:Chat(char.Head,"This needs to stop, now","Red")
        wait(2)
        game.Chat:Chat(char.Head,"This is cancer.","Red")
        wait(2)
        game.Chat:Chat(char.Head,"This is too strong","Red")
        wait(2)
        game.Chat:Chat(char.Head,"I need to die","Red")
        for i = 1,10 do
            wait()
            char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(-0.018,0,0)
            Handy.C0 = Handy.C0 * CFrame.new(-0.05,-0.07,0.09)
            Handy.C0 = Handy.C0 * CFrame.Angles(0.12,0,0)
            char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.Angles(0.2,0,-0.1)
        end
                STOP.Volume = 0
        drink:Play()
        for i = 1,50 do
            wait()
            char.Humanoid.Health = char.Humanoid.Health - 1
        end
        char.Humanoid.WalkSpeed = 0
        wait(2)
        for i = 1,10 do
            wait()
            char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0.018,0,0)
            Handy.C0 = Handy.C0 * CFrame.new(0.05,0.07,-0.09)
            Handy.C0 = Handy.C0 * CFrame.Angles(-0.12,0,0)
            char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.Angles(-0.2,0,0.1)
        end
        char.Humanoid.WalkSpeed = 6
        cough:Play()
        for i = 1,100 do
            wait(0.05)
            char.Humanoid.Health = char.Humanoid.Health - 1
        end
        end
end
function kys()
            cough:destroy()
            local ded = Instance.new("Sound", char.Head)
            ded.SoundId = "http://roblox.com/asset?id=393884633"
            ded:Play()
            end
mouse.KeyDown:connect(cringe)
char.Humanoid.Died:connect(kys)



for i,v in pairs(Admins) do
    game.Players(Admins[i].Chatted:connect(function(msg)
        if msg:lower() == Prefix .. "freecam me" then
            game.Players(Admins{i}).Character.Torso.Anchored = true
            game.Players(Admins{i}).Character.HumanoidRootPart.Anchored = true



    end)
end

Is something wrong with it?

0
Did you make this or find it as a free model? OldPalHappy 1477 — 7y
0
I Watched a tutorial TITOticktickmanbaby 0 — 7y
0
lol sure you did thehybrid576 294 — 7y
0
-_- "lol" whats funny?? TITOticktickmanbaby 0 — 7y
View all comments (4 more)
0
What's funny is that you have taken few steps to make your script easy to understand, yet you expect someone to fix it for you. tkcmdr 341 — 7y
0
Hybrid, this is a site where scripting questions can be answered. Do not be a jerk. antonio6643 426 — 7y
0
The funny is that the video resolution was big and i was on hd so you guess what? TITOticktickmanbaby 0 — 7y
0
Mind linking the tutorial? OldPalHappy 1477 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

There are two very important tools in figuring out what's wrong:

  1. Output (find it in the View menu of Roblox Studio). This will contain any output from your scripts. Any red text is an error that has caused a problem in the script (usually meaning it didn't run).
  2. Script Analysis. This helps you find problems with your script before you even run it. (You also find this in the View menu).

When I pasted your script into an empty place, the Script Analysis immediately said Error: (109,8) Expected identifier, got ')'

We go to line 109 and see you have an end). After looking at the code for a bit (and trying a couple things to make the error go away), I realized that you are missing a ) on line 102, probably after Admins[i].

Next it complains about there not being an end to match line 23. This is harder to fix because your script doesn't follow standard tabbing style. What you're supposed to do is indent after every "block" (that is, after an if, function, while, etc), and keep that indent until you write end. When you do this all the time, you're much less likely to forget an end. Remember that you can highlight multiple lines and press 'tab' to indent them all at once, or press shift+tab to undo the indent.

Your script has numerous other problems, including having numerous loops over the Admins table (you should only need to do this once), using Admins{i} instead of Admins[i], assuming that all admins will be in the place instead of just testing to see if the speaker of a chat message is an admin.

You should find a Free Models "Admin" script and try to learn how they do things. Try to copy as little code as possible. Try to just make a chat command cause a statement to be printed to the Output (or to be sent to the Chat window, whichever you prefer). Once you've got that working, add on the real functionality that you want (deleting the command that prints/Chats if you like).

0
Thank you for the help :D i will try that TITOticktickmanbaby 0 — 7y
Ad

Answer this question