Alright so i'm basically making a move script and everything is working except now that I put multiple "walls" (wall = game.Workspace.walls:GetChildren), it will pass thru every single wall but 1. I want it to stop at all walls.
(This is a local script)
plr = game.Players.LocalPlayer
mouse = plr:GetMouse()
arrow = game.Workspace.point
move = nil
wall = game.Workspace.walls:GetChildren()
function CheckUp()
local b = Instance.new("Part", game.Workspace)
b.Name = "FINDER"
b.Anchored = true
b.CFrame = arrow.CFrame + Vector3.new(4,0,0)
for i,v in pairs(wall) do
if b.CFrame.X == wall[i].CFrame.X then
move = false
print("Wall infront")
else
move = true
end
end--for end
end --function end
mouse.KeyDown:connect(function(key)
if key == "w" then
print("w")
CheckUp()
if move == false then
arrow.CFrame = arrow.CFrame + Vector3.new(0,0,0)
else
arrow.CFrame = arrow.CFrame + Vector3.new(4,0,0)
end
end
end)
