A bow shoots arrows, a sling throws cobblestone and a spear flies far and hard. Hold one and Interact looking where you'd like it to go. They hit creatures from afar (a Gloomling pops at an arrow), and arrows that miss can sometimes be found again; a thrown spear comes back to you. Make them at a workbench.
| 1 | name = "Bows, slings and spears" |
| 2 | by = "Potluck" |
| 3 | kind = "mod" |
| 4 | about = "A bow shoots arrows, a sling throws cobblestone and a spear flies far and hard. Hold one and Interact looking where you'd like it to go. They hit creatures from afar (a Gloomling pops at an arrow), and arrows that miss can sometimes be found again; a thrown spear comes back to you. Make them at a workbench." |
| 5 | main = "main.luau" |
| 6 | version = 1 |
| 7 | license = "CC-BY-4.0" |
| 8 | |
| 9 | [needs] |
| 10 | world = "0.28" |
| 11 | tweak = "0.1" |
| 12 | ui = "0.2" |
| 13 | sound = "0.2" |
| 14 | |
| 15 | # A bow's string, a sling's whirr and a spear's throw, and something hit. |
| 16 | [sounds.twang] |
| 17 | caption = "A bowstring twangs" |
| 18 | wave = "triangle" |
| 19 | pitch = [220, 160] |
| 20 | length = 0.3 |
| 21 | attack = 0.002 |
| 22 | decay = 0.12 |
| 23 | |
| 24 | [[sounds.twang.layers]] |
| 25 | wave = "noise" |
| 26 | pitch = 2400 |
| 27 | length = 0.08 |
| 28 | attack = 0.002 |
| 29 | decay = 0.03 |
| 30 | highpass = 1200 |
| 31 | gain = 0.6 |
| 32 | |
| 33 | [sounds.whirr] |
| 34 | caption = "A sling whirrs" |
| 35 | wave = "noise" |
| 36 | pitch = [600, 1800] |
| 37 | length = 0.3 |
| 38 | attack = 0.08 |
| 39 | decay = 0.08 |
| 40 | lowpass = 2600 |
| 41 | highpass = 300 |
| 42 | |
| 43 | [sounds.whoosh] |
| 44 | caption = "A spear is thrown" |
| 45 | wave = "noise" |
| 46 | pitch = [1400, 500] |
| 47 | length = 0.4 |
| 48 | attack = 0.03 |
| 49 | decay = 0.15 |
| 50 | lowpass = 1800 |
| 51 | |
| 52 | [sounds.thud] |
| 53 | caption = "Something hits" |
| 54 | wave = "sine" |
| 55 | pitch = [180, 90] |
| 56 | length = 0.15 |
| 57 | attack = 0.002 |
| 58 | decay = 0.06 |
| 59 | |
| 60 | [[sounds.thud.layers]] |
| 61 | wave = "noise" |
| 62 | pitch = 900 |
| 63 | length = 0.06 |
| 64 | attack = 0.001 |
| 65 | decay = 0.02 |
| 66 | lowpass = 1500 |
| 67 | gain = 0.7 |