|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Feb 2013 09:05 PM |
If that doesn't work, try adding "s around the names, but not []s.
~~Beginner Scripter |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2013 09:09 PM |
| Doesn't work, and I just get an error if I add "s |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2013 09:13 PM |
Hold on, let me go test it.
~~Beginner Scripter |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2013 09:13 PM |
| "Reset" works, "Hobos" doesn't. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 04 Feb 2013 11:40 PM |
| Two same names for two functions. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
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 |
|
|
| |
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|