generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Admin not working

Previous Thread :: Next Thread 
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
04 Feb 2013 08:37 PM
local isAdmin = {["MrRoboTaco"] = true, ["FreeGamesROBLOX"] = true, ["OmegaPowerful"] = true}

function onChatted(message, player)
if message == "reset" and isAdmin[player.Name] then
player.Character:BreakJoints()
end
end

function onChatted(message, player)
if message == "hobos" and isAdmin[player.Name] then
player.Character.Humaniod.Health = player.Character.Humaniod.Health - 10
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

It works when there is only one command, but when I add the command "hobos", neither command works.
Report Abuse
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
04 Feb 2013 08:50 PM
Hello?
Report Abuse
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
04 Feb 2013 09:01 PM
Trying this, but it isn't working either.
local isAdmin = {["MrRoboTaco"] = true, ["FreeGamesROBLOX"] = true, ["OmegaPowerful"] = true}

function onChatted(message, player)
if message == "reset" and isAdmin[player.Name] then
player.Character:BreakJoints()
end

elseif message == "hobos" and isAdmin[player.Name] then
player.Character.Humanoid.Health = player.Character.Humaniod.Health - 10
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Feb 2013 09:04 PM
    local isAdmin = {MrRoboTaco = true, FreeGamesROBLOX = true, OmegaPowerful = true}
    Game.Players.PlayerAdded:connect(function(player)
      player.Chatted:connect(function(message)
        if message == "reset" and isAdmin[player.Name] then
          player.Character:BreakJoints()
        elseif message == "hobos" and isAdmin[player.Name] then
          player.Character.Humanoid.Health = player.Character.Humaniod.Health - 10
        end
      end)
    end)

~~Beginner Scripter
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Feb 2013 09:05 PM
If that doesn't work, try adding "s around the names, but not []s.

~~Beginner Scripter
Report Abuse
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
04 Feb 2013 09:09 PM
Doesn't work, and I just get an error if I add "s
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Feb 2013 09:13 PM
Hold on, let me go test it.

~~Beginner Scripter
Report Abuse
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
04 Feb 2013 09:13 PM
"Reset" works, "Hobos" doesn't.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Feb 2013 09:23 PM
I honestly don't know.

Try doing:

humanoid = player.Character:findFirstChild("Humanoid")
if humanoid then
humanoid.Health = humanoid.Health - 10
end

~~Beginner Scripter
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
04 Feb 2013 11:40 PM
Two same names for two functions.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
05 Feb 2013 02:27 AM
At the endof the script, you added two functions, and only put 1 end).

Try ending it once more, if not, tell us the output.
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
05 Feb 2013 02:43 AM
[ Content Deleted ]
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
05 Feb 2013 07:18 AM
Cant believe nobosy spotted this, it's Humanoid not Humaniod
Report Abuse
MrRoboTaco is not online. MrRoboTaco
Joined: 06 Nov 2012
Total Posts: 470
05 Feb 2013 07:23 AM
AH Thanks awas!
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
05 Feb 2013 10:17 AM
xD No problem.


l=~/A3\~=l
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image