joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 05:31 PM |
Can you tell me what is wrong with this script? I have all of the Hierarchy stuff right. I think there might be something wrong with the names. I need help. Thank you.
Base=game.Workspace.Standing function onChatted(message, player) if message == "Line up at line 1" and player.Name=="joketo" or "hollywood1416" or "jos333" or "SuggestionDepartment" or "getkoed" then Base.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") wait(0.2) Base.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") wait(0.2) Base.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") wait(0.2) Base.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") end end function onChatted(message, player) if message == "Line up at line 2" and player.Name==("joketo" or "hollywood1416" or "jos333" or "SuggestionDepartment" or "getkoed") then Base.Line2.SelectionBox.BrickColor.new("Royal purple") wait(0.2) Base.Line2.SelectionBox.BrickColor=BrickColor.new("Really black") wait(0.2) Base.Line2.SelectionBox.BrickColor.new("Royal purple") wait(0.2) Base.Line2.SelectionBox.BrickColor=BrickColor.new("Really black") end end function onChatted(message, player) if message == "Line up at line 3" and player.Name==("joketo" or "hollywood1416" or "jos333" or "SuggestionDepartment" or "getkoed") then Base.Line3.SelectionBox.BrickColor.new("Royal purple") wait(0.2) Base.Line3.SelectionBox.BrickColor=BrickColor.new("Really black") wait(0.2) Base.Line3.SelectionBox.BrickColor.new("Royal purple") wait(0.2) Base.Line3.SelectionBox.BrickColor=BrickColor.new("Really black") end end |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 05:33 PM |
| The 'or' part, it just thinks you mean true, |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 05:34 PM |
'Base.Line3.SelectionBox.BrickColor.new("Royal purple")' BINGO |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 05:35 PM |
@Proxy so should I just replace it with a comma?
|
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
| |
|
|
| 21 Oct 2013 05:36 PM |
| I GOT MIXED UP @ FIRST POST, SECOND IS THE REAL ERROR! |
|
|
| Report Abuse |
|
|
| |
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 05:37 PM |
| I am crossing my fingers for it to work:D |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 05:47 PM |
| Alright well it has not gotten any better so I am just splitting the commands up into three separate scripts |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 06:02 PM |
Ok now what is wrong here: local isAdmin = {["joketo"]=true, ["hollywood1416"]=true, ["jos333"]=true, ["SuggestionDepartment"]=true, ["getkoed"]= true} function onChatted(message, player) if message == "Line up at line 1" and isAdmin[player.Name]then Base.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") wait(0.2) game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") wait(0.2) game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") wait(0.2) game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
|
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 06:04 PM |
Tip: Post output, this would have been solved within 5 minutes if you did (or at least an error would have easily been pointed out).
if the SelectionBox's are actually of the SelectionBox Class, they don't have a BrickColor property; it's Color. |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 06:37 PM |
| I was wondering about that color class. And I could not have an output that actually read and processed the script because the script ran after the chat command, and you can not chat in build or edit mode. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 06:39 PM |
"And I could not have an output that actually read and processed the script because the script ran after the chat command, and you can not chat in build or edit mode." Then manually call the functions. |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 06:49 PM |
| I know this is a stupid question but how do you call a function again? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 06:56 PM |
hi = function() print("y") end
hi() |
|
|
| Report Abuse |
|
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
| |
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 07:09 PM |
How would you call the function with this script: local isAdmin = {["joketo"]=true, ["hollywood1416"]=true, ["jos333"]=true, ["SuggestionDepartment"]=true, ["getkoed"]= true}
function onChatted(message, player) if message == "Line up at line 1" and isAdmin[player.Name]then game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Royal purple") game.Workspace.Standing.Line1.SelectionBox.BrickColor=BrickColor.new("Really black") end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
|
|
|
| Report Abuse |
|
|
| |
|
joketo
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 164 |
|
|
| 21 Oct 2013 07:46 PM |
| I changed it into a onClicked function. It works now. |
|
|
| Report Abuse |
|
|
08C
|
  |
| Joined: 26 Jan 2013 |
| Total Posts: 847 |
|
| |
|