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

My Admin script that allows me to kick,ban,speed and mute players dont work?HELP! [closed]

Asked by 6 years ago
Edited 6 years ago
local Mods = {"Danielp533"}

function Kick(msg)
    for _,plrs in pairs(game.Players:GetChildren()) do 
        if msg == ":kick " .. plrs then 
            game.StarterGui.ScreenGui.You_Was_Kicked.Visible==true and game.Players[plrs]:kick--when you get kicked a gui that says you was kicked appears on the screen..then it kicks you..i made the gui
end
end
end


game.Players.PlayerAdded:Connect(function(plr)
    for _,Admin in pairs(Mods) do 
        if plr.Name == Mods then
            plr.Chatted:Connect(Kick)
        end
    end
end)
function Mute(msg)
    for _,plrs in pairs(game.Players:GetChildren()) do 
        if msg == ":mute " .. plrs then 
            game.Players[plrs]:local Mute = script:FindFirstChild("Mute"):clone() - Clones the script that mutes him
 if Mute then -- Checks if the mute script is there
                local PlayerGui = plr:WaitForChild("PlayerGui")
                Mute.Parent = PlayerGui
                Mute.Disabled = false
            end

        end
    end
end

game.Players.PlayerAdded:Connect(function(plr)
    for _,Admin in pairs(Mods) do
        if plr.Name == Mods then 
            plr.Chatted:Connect(Mute)
        end
    end
end)
function Speed(msg)
    for _,plrs in pairs(game.Players:GetChildren()) do 
        if msg == ":speed " .. plrs..50 then 
            game.Players[plrs].LocalPlayer.Character.Humanoid.Walkspeed=50
else if msg == ":speed " .. plrs..25 then
game.Players[plrs].LocalPlayer.Character.Humanoid.Walkspeed=25
else if msg == ":speed " .. plrs..35 then
game.Players[plrs].LocalPlayer.Character.Humanoid.Walkspeed=35
end
game.Players.PlayerAdded:Connect(function(plr)
    for _,Admin in pairs(Mods) do
        if plr.Name == Mods then 
            plr.Chatted:Connect(Speed)

function Ban(msg)
    for _,plrs in pairs(game.Players:GetChildren()) do 
        if msg == ":ban " .. plrs then 
       game.StarterGui.ScreenGui.You_Was_Banned.Visible=true
        m=1
      while m=1
            game.Players[plrs]:kick--the while loop is so they can never join back to same server since m is always 1
game.Players[plrs]:kick--a backup just in case
game.Players.PlayerAdded:Connect(function(plr)
    for _,Mods in pairs(Mods) do
        if plr.Name == Mods then 
            plr.Chatted:Connect(Ban)
0
Modify your script so that it detects the msg being put into the chat. It is not defined that way but it should be. DeceptiveCaster 3761 — 6y

Closed as Non-Descriptive by RubenKan

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?