|
| 25 Aug 2013 11:21 PM |
Well I want to create a brick that is only visible to the current player. Yes it is a local script.
local cam = game.Workspace.CurrentCamera do wait() local block = Instance.new("Part") block.Name = "Block" block.Parent = cam block.Color = Color3.new(math.random()) end
Any help on what I did wrong? |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 11:25 PM |
| I think the color might be wrong |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 11:26 PM |
@mad
The color is random. Thanks for the useful information. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 11:35 PM |
| I know the color is Random, But I think you would have to do random, random, random or something like that |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Aug 2013 11:43 PM |
change "block.Color = Color3.new(math.random())" to
block.BrickColor = BrickColor.Random() |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 11:55 PM |
Testing it right now and it works fine.
local cam = game.Workspace.CurrentCamera while wait(0.2) do --I assume it was mean to be a loop? local block = Instance.new("Part") block.Name = "Block" block.Parent = cam block.Color = Color3.new(math.random(),math.random(),math.random()) --block.BrickColor = BrickColor.Random() works just as well block.CFrame = CFrame.new(0,20,0) --I found that if I didn't position it, it just fell off the map. end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Aug 2013 11:56 PM |
You can't Color3 on a Part.
Also, no he didn't mean a loop. |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 12:00 AM |
Really? What's the purpose of using just "do" then?
Surprisingly, you can change a parts color using Color3. Instead of using BrickColor, just use Color.
workspace.Part.Color = Color3.new(1,1,1) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Aug 2013 12:02 AM |
Since when? Oh well
Also, it's probably so he can add a place so he can "minimize" that part of the script. (Like that minus button on the left-side) |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 02:47 AM |
| You can't really change the part's color into a Color3 value, though with the .Color property, it'll give you the closest BrickColor match. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 26 Aug 2013 04:46 AM |
"Purpose of a do - end block".
Local variables. It creates a new scope. Example;
a = 3 do local a = 2 print(a) end print(a) do print(a) end
prints: 2 3 3
|
|
|
| Report Abuse |
|
|