Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onPlayerPing(player, position, object)
- local objects = Physics.cast({
- origin = position:add(vector(0, 100, 0)),
- direction = vector(0, -10, 0),
- type = 1, -- ray
- debug = true
- })
- if #objects > 0 and objects[1].hit_object.guid then
- local msg = "Raycast found ".. objects[1].hit_object.getName()
- broadcastToColor(msg, player.color)
- else
- broadcastToColor("Found nothing", player.color)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment