of     1   

Scerzy
#183110574Saturday, February 06, 2016 8:48 PM GMT

This is something totally new to me So I want a any brick named "Rainbow Brick" to get sucked towards a part I have once their Y position is less than 19.5. sorry if the script is terrible, I'm sort of new to this whole thing. The output gives no error but it doesn't work local hole = script.Parent local child = game.Workspace.PartStorage:GetChildren("Rainbow Brick") if child.Anchored==false and child.Position.Y<=19.5 then local relPos = hole.Position - child.Position local motivator = child:FindFirstChild("BlackHole Influence") if relPos.magnitude<=25 then if motivator == nil then motivator = Instance.new("BodyPosition") motivator.Parent = child motivator.Name = "BlackHole Influence" end motivator.position = hole.Position motivator.maxForce = 500 end end A new brick is added to PartStorage every 2 seconds What did I do wrong?
Scerzy
#183127706Sunday, February 07, 2016 1:44 AM GMT

bump
Scerzy
#183162153Sunday, February 07, 2016 6:14 PM GMT

bump2
cheesecake123456
#183162505Sunday, February 07, 2016 6:21 PM GMT

GetChildren() returns a table and takes no arguments, so you cannot say: GetChildren('Rainbow Brick') or child.Anchored == true If part storage contains parts that aren't rainbow bricks, you could do: child = {} for _, v in pairs(workspace.PartStorage:GetChildren()) do if v.Name == 'Rainbow Brick' then table.insert(child, v) end end Otherwise, if all parts are called rainbow brick, you can just do: child = workspace.PartStorage:GetChildren() Since it is a table, you must loop through it for every part, instead of treating it as a singular part, e.g: for _, v in pairs(child) do if v.Anchored==false and v.Position.Y<=19.5 then --code end end
Scerzy
#183178464Sunday, February 07, 2016 10:28 PM GMT

Thank you, finally making some progress with this script. Now I'm trying to find the next problem with the script.

    of     1