minetest.sound_play("some_sound_01", {
pos = self.object:getpos(),
gain = 0.7,
})
minetest.sound_play("some_sound_02", {
pos = self.object:getpos(),
gain = 0.5,
})
Mossmanikin wrote:Do you mean something like:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.?
- Code: Select all
minetest.sound_play("some_sound_01", {
pos = self.object:getpos(),
gain = 0.7,
})
minetest.sound_play("some_sound_02", {
pos = self.object:getpos(),
gain = 0.5,
})
minetest.register_abm({
nodenames = {"camo:turret_computer"},
interval = 2,
chance = 1,
action = function(pos, node)
local objects = minetest.env:get_objects_inside_radius(pos, 20)
for _,obj in ipairs(objects) do
if not obj:is_player() then
music_handle=minetest.sound_play("industrial_siren",
{pos = pos, gain = 1.0, max_hear_distance = 25,})
end
end
end
})
minetest.register_abm({
nodenames = {"camo:mob_turret"},
interval = 1,
chance = 1,
action = function(pos, node)
local objects = minetest.env:get_objects_inside_radius(pos, 20)
if minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= 'camo:turret_computer' then return end
for _,obj in ipairs(objects) do
if not obj:is_player() then
local obj_p = obj:getpos()
local calc = {x=obj_p.x - pos.x,y=obj_p.y+1 - pos.y,z=obj_p.z - pos.z}
local bullet=minetest.env:add_entity({x=pos.x,y=pos.y,z=pos.z}, "camo:arrow_entity")
bullet:setvelocity({x=calc.x * ARROW_VELOCITY,y=calc.y * ARROW_VELOCITY,z=calc.z * ARROW_VELOCITY})
music_handle=minetest.sound_play("gun",
{pos = pos, gain = 1.0, max_hear_distance = 25,})
end
end
end
})
Users browsing this forum: No registered users and 16 guests