Let r=ride tickets and e=entry tickets
Set up the following equations
r+e=40
4r + 2e = 120
Take the first equation and solve for e
e = 40-r
Substitute this into the second equation and solve for r
4r + 2(40 - r) = 120
4r + 80 - 2r = 120
2r = 40
r = 20
20 ride tickets were sold