-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.lua
56 lines (45 loc) · 1.41 KB
/
script.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--get rid of model
vanilla_model.ALL:setVisible(false)
--remove shadow
renderer:shadowRadius(0)
--setup sprite
local sprite = models.model.Camera:newSprite("nextbot_texture")
sprite:setTexture(textures["texture"])
--IMPORTANT! size the texture renders as
local renderSizeX, renderSizeY = 50, 50
--set UV to whole texture, set position relative to anchor, set proper render type
sprite:setUV(0, 0):setRegion(sprite:getDimensions()):setSize(renderSizeX, renderSizeY):setPos(renderSizeX / 2, renderSizeY, 0):setRenderType("TRANSLUCENT")
--sound stuffs
local mainPage = action_wheel:newPage()
action_wheel:setPage(mainPage)
local currentSound
function pings.playSound(sound)
currentSound = sounds:playSound(sound, player:getPos(), nil, nil, true)
end
function pings.stopSounds()
currentSound = nil
sounds:stopSound()
end
mainPage:newAction()
:title("Stop All Sounds")
:item("minecraft:barrier")
:onLeftClick(function()
pings.stopSounds()
end)
for _, sound in ipairs(sounds:getCustomSounds()) do
mainPage:newAction()
:title("Play " .. sound)
:item("minecraft:note_block")
:onLeftClick(function()
if currentSound then
print("Already playing something!")
else
pings.playSound(sound)
end
end)
end
function events.tick()
if currentSound then
currentSound:setPos(player:getPos())
end
end