Garry's Mod

Garry's Mod

View Stats:
Habarich Jan 9, 2024 @ 12:14pm
Want to make song bind
how do i bind: lua_run_cl Entity(1):EmitSound(Sound("music/vlvx_song27.mp3"))
to a key? or is there any other way to do that?
Originally posted by Maize (Eziam One):
if you're just playing it for yourself, just do bind KEY "play music/vlvx_song27.mp3"
< >
Showing 1-4 of 4 comments
Mixxed Jan 9, 2024 @ 1:55pm 
Create a file called playsound.lua and place it in

C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua\autorun

and paste the lua code below in it.

if CLIENT then
concommand.Add("playsound", function()
if IsValid(LocalPlayer()) then
LocalPlayer():EmitSound(Sound("music/vlvx_song27.mp3"))
end
end)
end


Then you can do "bind i playsound"
Last edited by Mixxed; Jan 9, 2024 @ 1:59pm
Habarich Jan 9, 2024 @ 3:54pm 
Originally posted by Mixxed:
Create a file called playsound.lua and place it in

C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua\autorun

and paste the lua code below in it.

if CLIENT then
concommand.Add("playsound", function()
if IsValid(LocalPlayer()) then
LocalPlayer():EmitSound(Sound("music/vlvx_song27.mp3"))
end
end)
end


Then you can do "bind i playsound"
Will try a bit later, thanks already i guess
Habarich Jan 10, 2024 @ 2:31am 
maybe its me stupid, but its not working. how should look the command in console in my case btw? maybe there is something more than "bind (key) playsound"?
The author of this thread has indicated that this post answers the original topic.
Maize (Eziam One) Jan 10, 2024 @ 3:54am 
if you're just playing it for yourself, just do bind KEY "play music/vlvx_song27.mp3"
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Jan 9, 2024 @ 12:14pm
Posts: 4