iiMitchie
|
  |
| Joined: 28 Dec 2012 |
| Total Posts: 74 |
|
|
| 13 Jan 2016 05:09 PM |
I Need Help Making a Block that makes another block. Like its for these balls that will fall down a hill and kill people, well I can't figure out how to make a brick fall then another one be created and then that one falls. Also this block will have a mesh in it so I can't necessarily do this...
while true do p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,1) p.Name = "Brick" p.BrickColor = BrickColor.new("Grey") p.TopSurface = ("Smooth") p.BottomSurface = ("Smooth") p.Parent = script.Parent.Parent.Parent p.Shape = 0 wait(4) end
Because how do I get a mesh into that block that I just created. If anyone has any ideas please let me know because I've only been scripting for 3 months. Thanks!!!
~iiMitchie
~iiMitchie |
|
|
| Report Abuse |
|
|
lupine
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 3561 |
|
|
| 13 Jan 2016 05:15 PM |
They're 2 solutions.
1. Premake the "kill part" and store it in ServerStorage or ReplicatedStorage. Your code in this case will look like
while wait(4) do local p = game.ServerStorage.KillPart:Clone() p.CFrame = script.Parent.CFrame p.Parent = script.Parent.Parent.Parent end
2. You can totally put the mesh inside the part with the script. In this chunk, notice that 'Mesh' has to be a child of the script and called 'Mesh'
while wait(4) do local p = Instance.new("Part") p.Position = script.Parent.Position p.FormFactor = Enum.FormFactor.Symmetric p.Size = Vector3.new(1,1,1) p.Name = "Brick" p.BrickColor = BrickColor.Gray() p.TopSurface = Enum.TopSurface.Smooth p.BottomSurface = Enum.BottomSurface.Smooth
local m = script["Mesh"]:Clone() m.Parent = p
p.Parent = script.Parent.Parent.Parent
I also put a few variations in there that I use personally. You don't have to use those yourself, but they'd be pretty ok habits to get into. |
|
|
| Report Abuse |
|
|
iiMitchie
|
  |
| Joined: 28 Dec 2012 |
| Total Posts: 74 |
|
|
| 13 Jan 2016 05:27 PM |
Ok so I added the brick with the mesh and kill script into server storage and this is my droppers script...
print'Test'
reload = 4 -- Change Wait Time for Each Brick...
while true do local p = game.ServerStorage.KillBrickTop:Clone() p.CFrame = script.Parent.CFrame p.Parent = script.Parent.Parent.Parent wait(reload) end
and it says there is nothing wrong with it but it isnt spawning at the dropper every four seconds. explain?
~iiMitchie |
|
|
| Report Abuse |
|
|
lupine
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 3561 |
|
|
| 13 Jan 2016 05:37 PM |
print("Test")
reload = 4
while wait(reload) do local p = game.ServerStorage.KillBrickTop:Clone() p.Position = script.Parent.Position p.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then hit.Humanoid.Health = 0 end end) p.Parent = script.Parent.Parent.Parent end
If that doesn't work, I'm not entirely sure what the problem is. Check if the script is disabled? Also, with this script, you can take the 'Kill script' out of your kill part. |
|
|
| Report Abuse |
|
|
iiMitchie
|
  |
| Joined: 28 Dec 2012 |
| Total Posts: 74 |
|
|
| 13 Jan 2016 05:57 PM |
Ok so I did that, and it keeps giving me this error in output. This is what it keeps saying ' 18:56:26.452 - Touched is not a valid member of Script ' . I have no idea, like... just... screw you scripting...
~iiMitchie |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2016 05:59 PM |
try fixin this line:
p.Parent = script.Parent.Parent.Parent |
|
|
| Report Abuse |
|
|