|
| 26 May 2013 11:10 AM |
Hey I'm trying to make snow on my place and I am using a brick that just drops other bricks however I want to add a function so that all new bricks are created with a point light in them. This is the script:
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(2,3,2) p.BrickColor = BrickColor.new("Institutional White") p.BottomSurface = 0 p.TopSurface = 0 p.CanCollide = false p.Name = "KillBrick" --DO NOT CHANGE/REMOVE p.Parent = script.Parent
local DmgScript = script.Parent.KillScript:Clone() -- The damage script clone DmgScript.Disabled = false --Enable the clone of it DmgScript.Parent = p end
while true do wait(1) --Alter Rate Of Drop fire() end
Am curious to where and how to add lighting script. Please ignore the "killbrick" function, it was for acid raid but changed it to snow now. |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:16 PM |
| The original part has a point light but I am having trouble recreating it in the clone. |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:18 PM |
put this into the fire function
local light = Instance.new("PointLight", p) |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 26 May 2013 12:19 PM |
Just add it after the p.Parent = script.Parent
light = Instance.new("PointLight") light.Parent = p |
|
|
| Report Abuse |
|
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 26 May 2013 12:20 PM |
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(2,3,2) p.BrickColor = BrickColor.new("Institutional White") p.BottomSurface = 0 p.TopSurface = 0 p.CanCollide = false p.Name = "KillBrick" --DO NOT CHANGE/REMOVE p.Parent = script.Parent
--What was added v --------------------------------------------- l = Instance.new("PointLight") l.Parent = p --------------------------------------------- local DmgScript = script.Parent.KillScript:Clone() -- The damage script clone DmgScript.Disabled = false --Enable the clone of it DmgScript.Parent = p end
while true do wait(1) --Alter Rate Of Drop fire() end
--------------------------------------------- This may not work, so let me know if it does/doesn't.
-Bogy |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:24 PM |
Added it in second line:
function fire() local p = Instance.new("Part") local light = Instance.new("PointLight", p) p.Position = script.Parent.Position p.Size = Vector3.new(2,3,2) p.BrickColor = BrickColor.new("Institutional white") p.BottomSurface = 0 p.TopSurface = 0 p.CanCollide = false p.Name = "KillBrick" --DO NOT CHANGE/REMOVE p.Parent = script.Parent
local DmgScript = script.Parent.KillScript:Clone() -- The damage script clone DmgScript.Disabled = false --Enable the clone of it DmgScript.Parent = p end
while true do wait(1) --Alter Rate Of Drop fire() end
Works good now but i tried to adjust the brightness and range and didnt work. I tried putting in: light.brightness = 10 light.range = 10 but nothing happened. |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:26 PM |
capital letters
light.Range light.Brightness
make sure it's EXACTLY after instancing the light |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:28 PM |
| Yep that works, of course only thing I did wrong was capitalization lol, thanks for help. |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 May 2013 12:37 PM |
Although that is all I need, how could you change the speed and direction the new brick falls in? Like making it come in from the side. One thing I am trying for speed is: local s = Instance.new ("Speed",p) s.Value = ?-Speed example? |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 12:41 PM |
BodyVelocity
wiki it or something |
|
|
| Report Abuse |
|
|