of     1   

CWRA0444
#184097637Sunday, February 21, 2016 9:02 PM GMT

Okay, so this script makes a brick get pushed when you touch it, towards the direction you pushed it in. The only problem is it only goes left and right for some reason; never back and forth. canPush = true script.Parent.Touched:connect(function(hit) if canPush == true then canPush = false local back = Vector3.new(script.Parent.CFrame.X + script.Parent.Size.X/2, script.Parent.Size.Y, script.Parent.Size.Z) local front = Vector3.new(script.Parent.CFrame.X - script.Parent.Size.X/2, script.Parent.Size.Y, script.Parent.Size.Z) local right = Vector3.new(script.Parent.Size.X, script.Parent.Size.Y, script.Parent.CFrame.Z - script.Parent.Size.X/2) local left = Vector3.new(script.Parent.Size.X, script.Parent.Size.Y, script.Parent.CFrame.Z + script.Parent.Size.X/2) local frontmag = (front - hit.Position).magnitude local backmag = (back - hit.Position).magnitude local leftmag = (left - hit.Position).magnitude local rightmag = (right - hit.Position).magnitude if frontmag < backmag and frontmag < rightmag and frontmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame - Vector3.new(-0.1, 0, 0) end elseif backmag < frontmag and backmag < rightmag and backmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame + Vector3.new(-0.1, 0, 0) end elseif rightmag < frontmag and rightmag < backmag and rightmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame - Vector3.new(0, 0, -0.1) end elseif leftmag < frontmag and leftmag < backmag and leftmag < rightmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, 0, -0.1) end end wait(1) canPush = true end end) ...thats why yellow makes me sad
CWRA0444
#184098147Sunday, February 21, 2016 9:09 PM GMT

I am completely baffled on this one. Please help. ...thats why yellow makes me sad
CWRA0444
#184099064Sunday, February 21, 2016 9:23 PM GMT

After troubleshooting, it seems front inputs as left and back inputs as right. ...thats why yellow makes me sad
Nickelele
#184099258Sunday, February 21, 2016 9:26 PM GMT

it reminds me of ocarina of time. xD http://www.roblox.com/games/228437605/RPG-IN-PROGRESS - 25R$, TEST FOR ME!
CWRA0444
#184099309Sunday, February 21, 2016 9:26 PM GMT

That was actually the inspiration :D ...thats why yellow makes me sad
Nickelele
#184099457Sunday, February 21, 2016 9:28 PM GMT

Oh my Oh my. Incoming Puzzle game? :D http://www.roblox.com/games/228437605/RPG-IN-PROGRESS - 25R$, TEST FOR ME!
CWRA0444
#184099747Sunday, February 21, 2016 9:32 PM GMT

My problem still remains though :/ ...thats why yellow makes me sad
Nickelele
#184099799Sunday, February 21, 2016 9:33 PM GMT

I tried fiddlering with the script. I changed something, now it moves all 4 ways. But its only if u push on the front side far to the left, and far to the right. http://www.roblox.com/games/228437605/RPG-IN-PROGRESS - 25R$, TEST FOR ME!
CWRA0444
#184100046Sunday, February 21, 2016 9:37 PM GMT

Alright, what'd you change? ...thats why yellow makes me sad
Nickelele
#184102327Sunday, February 21, 2016 10:12 PM GMT

I made the left and right work, but now front and back don't work. canPush = true script.Parent.Touched:connect(function(hit) if canPush == true then canPush = false local back = Vector3.new(script.Parent.CFrame.X + script.Parent.Size.X/2, script.Parent.Size.Y, script.Parent.Size.Z) local front = Vector3.new(script.Parent.CFrame.X - script.Parent.Size.X/2, script.Parent.Size.Y, script.Parent.Size.Z) local right = Vector3.new(script.Parent.Size.X, script.Parent.Size.Y, script.Parent.CFrame.Z + script.Parent.Size.X/2) local left = Vector3.new(script.Parent.Size.X, script.Parent.Size.Y, script.Parent.CFrame.Z - script.Parent.Size.X/2) local frontmag = (front - hit.Position).magnitude local backmag = (back - hit.Position).magnitude local leftmag = (left - hit.Position).magnitude local rightmag = (right - hit.Position).magnitude if frontmag < backmag and frontmag < rightmag and frontmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame - Vector3.new(-0.1, 0, 0) end elseif backmag < frontmag and backmag < rightmag and backmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame + Vector3.new(-0.1, 0, 0) end elseif rightmag < frontmag and rightmag < backmag and rightmag < leftmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame - Vector3.new(0, 0, 0.1) end elseif leftmag < frontmag and leftmag < backmag and leftmag < rightmag then for i = 1, 40 do wait() script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, 0, 0.1) end end wait(1) canPush = true end end) http://www.roblox.com/games/228437605/RPG-IN-PROGRESS - 25R$, TEST FOR ME!
Nickelele
#184103653Sunday, February 21, 2016 10:31 PM GMT

Take a look at your for loops. Two of them have the same increments, which means the box will only ever be able to move two directions. Change two of the for loops from negative to positive respective to their directions. http://www.roblox.com/games/228437605/RPG-IN-PROGRESS - 25R$, TEST FOR ME!

    of     1