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

Help with admin commands??

Asked by 10 years ago
local admin = {"Roboy5857"}
local banland = {"xMegs"}
local nonadmins = game.Workspace.Players-admin


local player = game.Players.LocalPlayer

local banland={"xMegs"}


player.Chatted:connect(function(msg)
    if admin.msg.Text == "dead all" then
        local hum=game.Workspace.Players:FindFirstChild("Humanoid")
        if hum then
            player.Humanoid.Health=0
        end
        if admin.msg.Text=="dead rob" then
            local rob = game.Workspace:FindFirstChild("Roboy5857")
            if rob then
                rob.Humanoid.Health=0
            end
        end
        if admin.msg.Text=="sword rob" then
            local hi = game.Workspace:FindFirstChild("Roboy5857")
            if hi then
                game.Workspace.Lighting.LinkedSword:Clone(Roboy5857.StarterPack)
            end
            if admin.msg.Text=="special sword rob" then
                local ss = game.Workspace:FindFirstChild("Roboy5857")
                if ss then
                    game.Workspace.Lighting.Darkheart:Clone(Roboy5857.StarterPack)
                end
                if admin.msg.Text=="speed all" then
                    local v = game.Workspace.Players+admin
                    v.Humanoid.WalkSpeed=50
                end
                if amdin.msg.Text=="speed others" then
                    local c = game.Workspace.Players-admin
                    c.Humanoid.WalkSpeed=50
                end
                if admin.msg.Text=="m line up" then
                    game.Workspace.Message.Text="Line up"
                    wait(5)
                end
                if admin.msg.Text=="health all" then
                    local h = game.Workspace.Players+admin
                    h.Humanoid.MaxHealth=150
                end
                if admin.msg.Text=="play themesong" then
                    game.Workspace.Sound:Play()
                    game.Workspace.Sound.Looped=true
                end
                if admin.msg.Text=="stop themesong" then
                    game.Workspace.Sound:Stop()
                end
                if admin.msg.Text=="gun rob" then
                    local gun = game.Workspace:FindFirstChild("Roboy5857")
                    if gun then
                        game.Workspace.Lighting.AssaultRifle:Clone(Roboy5857.StarterPack)
                    end
                    if admin.msg.Text=="gun other" then
                        local o = game.Workspace.Players-admin
                        if o then
                            game.Workspace.Lighting.AssaultRifle:Clone(o.StarterPack)
                        end
                    end
                end
            end
        end
    end
end)


game.Players.PlayerAdded:connect(function(newPlayer)
    if newPlayer.Name==banland then
        newPlayer:Kick()
    end
end)

It won't work!! D: Why?

1
wtf is line 3 wazap 100 — 10y
0
Line 3 is nonadmins... Can you read? Roboy5857 20 — 10y

3 answers

Log in to vote
0
Answered by 10 years ago

Sorry if this doesn't help any or doesn't work. Sorry that I used my own kind of script, but I couldn't really understand the script you were using.

admins={"Player1","Player2"}

function Chat(msg)

if msg:lower()=="test"then
print("Script works")
end

-- My Studio is broken so I'm not attempting to do :sub()'s

end

game:service("Players").Playeradded:connect(function(plr)
for i=1,#admins do
if plr.Name:lower()==admins[i] then
plr.Chatted:connect(Chat)
end end end)
Ad
Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
10 years ago

ok first of your "FindFirstChild" method was wrong its "findFirstChild" Capitalization counts.

here is what I did ( I added my own piece of code to :) )

local admin = {"Roboy5857"}
local banland = {"xMegs"}
local nonadmins = game.Workspace.Players-admin


local player = game.Players.LocalPlayer

local banland={"xMegs"}


player.Chatted:connect(function(msg)
    if admin.msg.Text == "dead all" then
        local hum=game.Workspace.Players:findFirstChild("Humanoid")
        if hum then
            player.Humanoid.Health=0
        end
        if admin.msg.Text=="dead rob" then
            local rob = game.Workspace:findFirstChild("Roboy5857")
            if rob then
                rob.Humanoid.Health=0
            end
        end
        if admin.msg.Text=="sword rob" then
            local hi = game.Workspace:findFirstChild("Roboy5857")
            if hi then
                game.Workspace.Lighting.LinkedSword:Clone(Roboy5857.StarterPack)
            end
            if admin.msg.Text=="special sword rob" then
                local ss = game.Workspace:findFirstChild("Roboy5857")
                if ss then
                    game.Workspace.Lighting.Darkheart:Clone(Roboy5857.StarterPack)
                end
                if admin.msg.Text=="speed all " then
                    local v = game.Workspace.Players+admin
                    v.Humanoid.WalkSpeed = math.random -- so players get a random walkspeed not just 50
                end
                if amdin.msg.Text=="speed others" then
                    local c = game.Workspace.Players-admin
                    c.Humanoid.WalkSpeed = math.random -- same as the top
                end
                if admin.msg.Text=="m Line Up" then
                    game.Workspace.Message.Text = "Line Up" 
                    wait(5)
                end
                if admin.msg.Text=="heal all" then
                    local h = game.Workspace.Players+admin
                    h.Humanoid.MaxHealth=100
                end
                if admin.msg.Text=="god all" then
                local h = game.Workspace.Players+admin
                h.Humanoid.MaxHealth = inf
                end

                if admin.msg.Text=="play themesong" then
                    game.Workspace.Sound:Play()
                    game.Workspace.Sound.Looped=true
                end
                if admin.msg.Text=="stop themesong" then
                    game.Workspace.Sound:Stop()
                end
                if admin.msg.Text=="gun rob" then
                    local gun = game.Workspace:findFirstChild("Roboy5857")
                    if gun then
                        game.Workspace.Lighting.AssaultRifle:Clone(Roboy5857.StarterPack)
                    end
                    if admin.msg.Text=="gun other" then
                        local o = game.Workspace.Players-admin
                        if o then
                            game.Workspace.Lighting.AssaultRifle:Clone(o.StarterPack)
                        end
                    end
                end
            end
        end
    end
end)


game.Players.PlayerAdded:connect(function(newPlayer)
    if newPlayer.Name==banland then
        newPlayer:Kick()
    end
end)

Log in to vote
0
Answered by 10 years ago

local admin = {"Roboy5857"}

02 local banland = {"xMegs"}

03 local nonadmins = game.Workspace.Players-admin

04

05

06 local player = game.Players.LocalPlayer

07

08 local banland={"xMegs"}

09

10

11 player.Chatted:connect(function(msg)

12 if admin.msg.Text == "dead all" then

13 local hum=game.Workspace.Players:findFirstChild("Humanoid")

14 if hum then

15 player.Humanoid.Health=0

16 end

17 if admin.msg.Text=="dead rob" then

18 local rob = game.Workspace:findFirstChild("Roboy5857")

19 if rob then

20 rob.Humanoid.Health=0

21 end

22 end

23 if admin.msg.Text=="sword rob" then

24 local hi = game.Workspace:findFirstChild("Roboy5857")

25 if hi then

26 game.Workspace.Lighting.LinkedSword:Clone(Roboy5857.StarterPack)

27 end

28 if admin.msg.Text=="special sword rob" then

29 local ss = game.Workspace:findFirstChild("Roboy5857")

30 if ss then

31 game.Workspace.Lighting.Darkheart:Clone(Roboy5857.StarterPack)

32 end

33 if admin.msg.Text=="speed all " then

34 local v = game.Workspace.Players+admin

35 v.Humanoid.WalkSpeed = math.random -- so players get a random walkspeed not just 50

36 end

37 if amdin.msg.Text=="speed others" then

38 local c = game.Workspace.Players-admin

39 c.Humanoid.WalkSpeed = math.random -- same as the top

40 end

41 if admin.msg.Text=="m Line Up" then

42 game.Workspace.Message.Text = "Anything"

43 wait(5)

44 end

45 if admin.msg.Text=="heal all" then

46 local h = game.Workspace.Players+admin

47 h.Humanoid.MaxHealth=100

48 end

49 if admin.msg.Text=="god all" then

50 local h = game.Workspace.Players+admin

51 h.Humanoid.MaxHealth = inf

52 end

53

54 if admin.msg.Text=="play themesong" then

55 game.Workspace.Sound:Play()

56 game.Workspace.Sound.Looped=true

57 end

58 if admin.msg.Text=="stop themesong" then

59 game.Workspace.Sound:Stop()

60 end

61 if admin.msg.Text=="gun rob" then

62 local gun = game.Workspace:findFirstChild("Roboy5857")

63 if gun then

64 game.Workspace.Lighting.AssaultRifle:Clone(Roboy5857.StarterPack)

65 end

66 if admin.msg.Text=="gun other" then

67 local o = game.Workspace.Players-admin

68 if o then

69 game.Workspace.Lighting.AssaultRifle:Clone(o.StarterPack)

70 end

71 end

72 end

73 end

74 end

75 end

76 end)

77

78

79 game.Players.PlayerAdded:connect(function(newPlayer)

80 if newPlayer.Name==banland then

81 newPlayer:Kick()

82 end

83 end)

Answer this question