Vending machine script error

The claw machine is not moving

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(model,claw,lowofx,maxofx,lowofz,maxofz)
    script.Parent.left.MouseButton1Click:Connect(function()
        if claw.Position.X < lowofx then
            print("to low")
        else
            claw.Position += game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector*-0.25
            print("moving")
        end
    end)
    script.Parent.right.MouseButton1Click:Connect(function()
        if claw.Position.X >= maxofx then
            print("too low")
        else
            claw.Position += game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector*0.25
            print("moving")
        end
    end)
    script.Parent.up.MouseButton1Click:Connect(function()
        if claw.Position.X < lowofz then
            print("too low")
        else
            claw.Position += game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector*0.25
            print("moving")
        end
    end)
    script.Parent.down.MouseButton1Click:Connect(function()
        if claw.Position.Z >= maxofz then
            print("too low")
        else
            claw.Position += game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector*0.25
            print("moving")
        end
    end)
end)
2 Likes

What’s the error?

30 charssssss

if claw.Position.X >= maxofx then -- max of x is -29, low of x is -25, claw.Position.X is -27, but its printing the below one
            print(lowofx.." is the left, and "..maxofx.." is the right point, "..claw.Position.X.." is current position x")

-29 would be minimum of x though?

its a grid system, also i fixed it thank you
here video: 2021-11-15 12-53-52.mp4 - Google Drive