Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.

Commit

Permalink
Add flag take sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Dec 1, 2015
1 parent d273457 commit 9804ec7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Copyright (c) 2013 - 2015
**Code:** LGPL 2.1 or later.
**Textures:** CC-BY-SA 3.0

ctf_flag/sounds/trumpet* by tobyk, license: CC-BY 3.0
from: http://freesound.org/people/tobyk/sounds/26198/

Modules
=======

Expand Down
19 changes: 19 additions & 0 deletions ctf_flag/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,22 @@ function minetest.is_protected(pos, name)
return old_is_protected(pos, name)
end
end

-- Play sound
ctf_flag.register_on_pick_up(function(attname, flag)
local vteam = ctf.team(flag.team)
for name, player in pairs(vteam.players) do
minetest.sound_play({name="trumpet_lose"}, {
to_player = name,
gain = 1.0, -- default
})
end

local ateam = ctf.team(ctf.player(attname).team)
for name, player in pairs(ateam.players) do
minetest.sound_play({name="trumpet_win"}, {
to_player = name,
gain = 1.0, -- default
})
end
end)
Binary file added ctf_flag/sounds/trumpet_lose.ogg
Binary file not shown.
Binary file added ctf_flag/sounds/trumpet_win.ogg
Binary file not shown.

0 comments on commit 9804ec7

Please sign in to comment.