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: What is wrong with this script?

Previous Thread :: Next Thread 
joketo is not online. 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
ProxyKiller is not online. ProxyKiller
Joined: 16 Oct 2013
Total Posts: 193
21 Oct 2013 05:33 PM
The 'or' part, it just thinks you mean true,
Report Abuse
ProxyKiller is not online. ProxyKiller
Joined: 16 Oct 2013
Total Posts: 193
21 Oct 2013 05:34 PM
'Base.Line3.SelectionBox.BrickColor.new("Royal purple")'
BINGO
Report Abuse
joketo is not online. 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 is not online. joketo
Joined: 30 Mar 2009
Total Posts: 164
21 Oct 2013 05:35 PM
Oh nvrm.
Report Abuse
ProxyKiller is not online. ProxyKiller
Joined: 16 Oct 2013
Total Posts: 193
21 Oct 2013 05:36 PM
I GOT MIXED UP @ FIRST POST, SECOND IS THE REAL ERROR!
Report Abuse
ProxyKiller is not online. ProxyKiller
Joined: 16 Oct 2013
Total Posts: 193
21 Oct 2013 05:36 PM
^ Got mixed up again
Report Abuse
joketo is not online. 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 is not online. 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 is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
21 Oct 2013 06:56 PM
hi = function()
print("y")
end

hi()
Report Abuse
joketo is not online. joketo
Joined: 30 Mar 2009
Total Posts: 164
21 Oct 2013 06:59 PM
Thank you
Report Abuse
joketo is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
21 Oct 2013 07:30 PM
onChatted("blah",you)
Report Abuse
joketo is not online. 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 is not online. 08C
Joined: 26 Jan 2013
Total Posts: 847
21 Oct 2013 07:49 PM
[ Content Deleted ]
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