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: I need help with a script

Previous Thread :: Next Thread 
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 04:43 PM
I've already written it out and such but it says on line 47 "c is not a valid member of Part"

Please look at it and let me know what's wrong. I'll do the same :)

local b = script.Parent
local c = BrickColor
local m = Material
local x = math.random(1,1000)
if x > 994 then --0.5
b.Name = "Diamond"
b.c = b.c.new("Teal")
b.m = "Ice"
elseif x > 995 and x > 984 then --1%
b.Name = "Sapphire"
b.c = b.c.new("Bright blue")
b.m = "Ice"
elseif x > 985 and x > 974 then --1%
b.Name = "Ruby"
b.c = b.c.new("Bright red")
b.m = "Ice"
elseif x > 975 and x > 964 then --1%
b.Name = "Emerald"
b.c = b.c.new("Bright green")
b.m = "Ice"
elseif x > 975 and x > 954 then --2%
b.Name = "Gold"
b.c = b.c.new("New Yeller")
b.m = "Foil"
elseif x > 955 and x > 924 then --3%
b.Name = "Quartz"
b.c = b.c.new("White")
b.m = "Ice"
elseif x > 925 and x > 874 then --5%
b.Name = "Silver"
b.c = b.c.new("Medium stone grey")
b.m = "Foil"
elseif x > 875 and x > 799 then --7.5%
b.Name = "Copper"
b.c = b.c.new("Bright orange")
b.m = "Foil"
elseif x > 800 and x > 699 then --10%
b.Name = "Coal"
b.c = b.c.new("Really black")
b.m = "Slate"
elseif x > 700 and x > 499 then --20%
b.Name = "Stone"
b.c = b.c.new("Dark stone grey")
b.m = "Slate"
elseif x < 500 then --50%
b.Name = "Dirt"
b.c = b.c.new("Dark orange") <---- Line 47 (This message isn't in the script)
b.m = "Concrete"
end

And BTW don't steal pls.
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
29 Aug 2013 04:46 PM
Very messy script btw but
local b = script.Parent
local c = b.BrickColor
local m = b.Material
That way your declaring the brick that is parent to your script
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 04:48 PM
Ok thanks! I get the "Your script is messy" thing a lot. Any suggestions how to clean it up? .-.
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
29 Aug 2013 04:51 PM
I suggest learning more about roblox tables and the "for loops"
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 04:55 PM
Well I also have a another problem now that you fixed the first one,

c = c.new("Really red")

Error: "new is not a valid member"

Do you know how to fix this ._.

I tried making new variables like cn = b.BrickColor.new, But it won't work. It still shows the error.
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
29 Aug 2013 04:57 PM
Don't use variables for .new maybe?
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 05:00 PM
I already tried and it's still not working I even did

b.BrickColor = b.BrickColor.new("Really red")

Error: "new is not a valid member"

X_x
Report Abuse
ProfitMargin is not online. ProfitMargin
Joined: 01 Aug 2013
Total Posts: 285
29 Aug 2013 05:01 PM
b.BrickColor = BrickColor.new("Really red")
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 05:02 PM
Ah I see now thanks. lol
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
29 Aug 2013 05:13 PM
Well I just had to polish it up a bit and like completely remove the variable since they DIDN'T WORK. At least I'm done now x)
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
29 Aug 2013 05:14 PM
Use Pairs and Tables.
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