Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- callbacks = variables.Callbacks
- engine = variables.Interfaces:Engine()
- sound = "music\\dominating"
- name = "dominating"
- gui = variables.gui
- gui:AddOption("hitsound", name)
- function onevent()
- if variables.event:GetName() == "player_hurt" then --someone hurt someone else
- attacker = engine:PlayerForUserID(variables.event:GetInt("attacker"))
- if attacker == engine:LocalPlayer() then --localplayer hurt someone else
- if gui:SelectedOption("hitsound", name) then --our custom hitsound is enabled
- engine:ExecuteCommand("playvol " .. sound .. " " .. gui:GetValue("hitsound_volume") * .01) --play our defined sound using the volume from the slider in the ui
- end
- end
- end
- end
- callbacks:Register(variables.GAMEEVENT, "onevent")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement