Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function table.find(table, element)
- for key, value in ipairs(table) do
- if value == element then
- return key
- end
- end
- return nil
- end
- function inRange(x,y,rx1,ry1,rx2,ry2) -- I think there's something wrong with this one, not sure tho
- if (x>=rx1 and x<=rx2 and y>=ry1 and y<=ry2) then
- return true
- end
- return false
- end
- function csconvert(rot,x,y,factor)
- if rot<-90 then rot=rot+360 end
- local angle=math.rad(math.abs(rot+90))-math.pi
- local cx=x+(math.cos(angle)*factor)
- local cy=y+(math.sin(angle)*factor)
- return cx,cy
- end
Advertisement
Add Comment
Please, Sign In to add comment