I used a tycoon starter kit, and then i altered the dropper, so that instead of falling, the blocks fly upwards! It works fine, on the first one. All of the blocks after the first one just fall but the first block works just fine!!! why is that so?!?!? Here is the script
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,1) --size if u know how this works then delete the --'s at the start p.BrickColor = BrickColor.new(194) --color, see the roblox lua documentation if u know how this works then delete the --'s p.BottomSurface = 0 p.TopSurface = 0 p.Name = "TycoonBrick" --If you change this, make sure you change the name in the get script too (in the collect profits model) p.Parent = script.Parent --start of my part local bf = Instance.new("BodyForce") bf.force = Vector3.new(0,250,0) bf.Parent = script.Parent.TycoonBrick end --end of my part while true do wait(script.Parent.Parent.SpeedValue.Value) --Alter Rate Of Drop fire() end --made by burnsy13
At line 13, you're parenting the BodyForce to the first TycoonBrick it finds in the script's parent. Parent it to p instead:
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,1) --size if u know how this works then delete the --'s at the start p.BrickColor = BrickColor.new(194) --color, see the roblox lua documentation if u know how this works then delete the --'s p.BottomSurface = 0 p.TopSurface = 0 p.Name = "TycoonBrick" --If you change this, make sure you change the name in the get script too (in the collect profits model) p.Parent = script.Parent --start of my part local bf = Instance.new("BodyForce") bf.force = Vector3.new(0,250,0) bf.Parent = p end --end of my part while true do wait(script.Parent.Parent.SpeedValue.Value) --Alter Rate Of Drop fire() end --made by burnsy13
Your problem is
bf.Parent = script.Parent.TycoonBrick
You set the BodyForce's Parent to "TycoonBrick", but you're naming every part "TycoonBrick". After the first one is created, how do you know which "TycoonBrick" the script will choose? After all, there are multiple Parts with the same name.
You already have the variable equal to the current Part (p
), so just use it.
local bf = Instance.new("BodyForce") bf.force = Vector3.new(0,250,0) bf.Parent = p
However, you should shorten this by using the second argument of Instance.new
.
local bf = Instance.new("BodyForce", p) bf.force = Vector3.new(0,250,0)