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 » Club Houses » Clans & Guilds
Home Search
 

Re: powerful scripters help me D :

Previous Thread :: Next Thread 
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 01:56 AM
why wont it change color D ::::::::::::::::::

function onClicked()

buttoncolor = math.random(1,3)
if buttoncolor == 1 then script.Parent.BrickColor = "Pastel Blue"
if buttoncolor == 2 then script.Parent.BrickColor = "Camo"
if buttoncolor == 3 then script.Parent.BrickColor = "Really red"
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Report Abuse
Voslaaarum is not online. Voslaaarum
Joined: 20 Apr 2011
Total Posts: 3121
07 Jan 2017 01:59 AM
the only two things I see weird here- however this is coming from a java scripter not lua but they're similar- is that you have buttoncolor = math.random(1,3), and that's a command to generate a random color or random SOMETHING connected to a value ( at least in java).

Only other thing I can think of is maybe you aren't pointing to the correct brick when you say script.Parent.BrickColor = "Pastel Blue".
Report Abuse
Voslaaarum is not online. Voslaaarum
Joined: 20 Apr 2011
Total Posts: 3121
07 Jan 2017 02:00 AM
NEVERMIND, YOU'RE JUST SCREWING UP THE COLOR NAMES.


REALLY RED ISN'T 'Really Red" it's "really Red"



first word = non capitalized, second word capitalized
Report Abuse
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 02:05 AM
um i dont think thats it
Report Abuse
Qivr is not online. Qivr
Joined: 22 Aug 2014
Total Posts: 5407
07 Jan 2017 02:06 AM
buttoncolor = math.random(1,3)
if buttoncolor == 1 then
script.Parent.BrickColor = "Pastel Blue"
elseif buttoncolor == 2 then
script.Parent.BrickColor = "Camo"
elseif buttoncolor == 3 then
script.Parent.BrickColor = "Really red"
end
end
Report Abuse
IntenseSnows is not online. IntenseSnows
Joined: 12 Mar 2011
Total Posts: 13345
07 Jan 2017 02:09 AM
what qivr said


Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:17 AM
local colours = {"Pastel blue"; "Really red"; "New Yeller"} -- add more in here
function onClicked()
script.Parent.BrickColor = BrickColor.new(colors[math.random(#colours)])
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

-------------------

The problem you had was you were:
#1 not properly ending the if statements
#2 not properly assigning brickcolor (which takes brickcolor, not a string)

#1 was a redundant issue, if statements aren't necessary. infact, what i gave you is inefficient there is a better way to do it because we're creating a new brickcolor every time you click. plus, __index calls to the parent, tsk tsk.

Qivr is wrong.
Report Abuse
Qivr is not online. Qivr
Joined: 22 Aug 2014
Total Posts: 5407
07 Jan 2017 02:18 AM
Ow Poly!
I honestly did not look deep into the script, I saw it was if statements that ran on and did not use "elseif" sorry I disappointed you dad :(
Report Abuse
55Altair is not online. 55Altair
Joined: 18 Oct 2008
Total Posts: 6272
07 Jan 2017 02:23 AM
for the record i just directly fixed his script and it worked but poly's didn't

function onClicked()

buttoncolor = math.random(1,3)
if buttoncolor == 1 then
script.Parent.BrickColor = BrickColor.new("Pastel Blue")
else if buttoncolor == 2 then
script.Parent.BrickColor = BrickColor.new("Camo")
else if buttoncolor == 3 then
script.Parent.BrickColor = BricckColor.new("Really red")
end
end
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
Solar_Sentient is not online. Solar_Sentient
Joined: 21 Dec 2013
Total Posts: 1323
07 Jan 2017 02:24 AM
thanks altair : 3
Report Abuse
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 02:24 AM
um they both work

you are both very powerful....
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:24 AM
opps, i made a stupid mistake.

BrickColor.new(colors[math.random(#colours)])

"colors[" should be "colours["

thats what i get for being canadian.
Report Abuse
55Altair is not online. 55Altair
Joined: 18 Oct 2008
Total Posts: 6272
07 Jan 2017 02:24 AM
looks like i am truly the superior programmer
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:25 AM
superior.. ##
Report Abuse
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 02:26 AM
ok polys script makes the brick turn grey sometimes


into the trash it goes
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:29 AM
"ok polys script makes the brick turn grey sometimes
into the trash it goes"

thats because your incompetence is spelling the colour wrong. NOT MY FAULT.
Report Abuse
Qivr is not online. Qivr
Joined: 22 Aug 2014
Total Posts: 5407
07 Jan 2017 02:30 AM
#########################################################################################################################################################################################################################################################################################
Report Abuse
55Altair is not online. 55Altair
Joined: 18 Oct 2008
Total Posts: 6272
07 Jan 2017 02:31 AM
I put Poly's script in my fort now my team spawns with Admiral pistols wtf?
Report Abuse
lork is not online. lork
Joined: 19 Jun 2008
Total Posts: 7166
07 Jan 2017 02:31 AM
hey lay off my friend or things are gonna ### ###### ##### for u bud
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:31 AM
altair can i put you in my fort.
Report Abuse
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 02:31 AM
you win this round monochromatic degenerate
Report Abuse
55Altair is not online. 55Altair
Joined: 18 Oct 2008
Total Posts: 6272
07 Jan 2017 02:32 AM
yes
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
07 Jan 2017 02:32 AM
im gonna have a lot of fun :P
Report Abuse
55Altair is not online. 55Altair
Joined: 18 Oct 2008
Total Posts: 6272
07 Jan 2017 02:34 AM
plz steam me what my character is gonna be doing in ur fort because i dont intend on raiding on this game ever again
Report Abuse
robb12 is not online. robb12
Joined: 09 Jul 2009
Total Posts: 32076
07 Jan 2017 02:35 AM
the admiral is gonna fire his pistol in your mouth
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Clans & Guilds
   
 
   
  • 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