Created
March 17, 2021 03:52
-
-
Save rchanou/bc3b0cc308baab65e4ed52d55e00c47d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local stateFirstLoad = true | |
local stateToolHeld = false | |
function RunResinRadar() | |
if stateFirstLoad then | |
stateFirstLoad = false | |
print("Initializing Resin Detector.") | |
ListenToGameEvent("weapon_switch", OnSwitch, itemTable) | |
local mTool = Entities:FindByClassname(nil, "hlvr_multitool") | |
stateToolHeld = IsValidEntity(mTool) | |
end | |
if stateToolHeld then | |
EmitResinSound() | |
end | |
end | |
function OnSwitch(itemTable) | |
stateToolHeld = itemTable["item"] == "hlvr_multitool" | |
end | |
function EmitResinSound() | |
local res = Entities:FindAllByClassname("item_hlvr_crafting_currency_small") | |
for k,v in pairs(res) do | |
EmitSoundOn("HackingPuzzle.TripminePulse", v) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment