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?
There are two very important tools in figuring out what's wrong:
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).