Say I want chatsounds for Pirate Ship Wars, would I be able to edit the DarkRP like:
[code]
GM:AddToggleCommand( "rp_chatsounds", "chatsounds", 1 )
local sounds = {}
sounds[ "hi" ] = { "vo/npc/male01/hi01.wav", "vo/npc/male01/hi02.wav" }
sounds[ "hello" ] = sounds[ "hi" ]
sounds[ "hey" ] = sounds[ "hi" ]
[/code]
[B]Too:[/B]
[code]
GM:AddToggleCommand( "pirate_chatsounds", "chatsounds", 1 )
local sounds = {}
sounds[ "Ye" ] = { "ye.wav" }
sounds[ "Brace Yarself" ] = sounds[ "brace.wav" ]
sounds[ "Fight" ] = sounds[ "fight.wav" ]
[/code]
Don't use GM hooks unless you're creating a new game mode.
Instead, use [URL="http://wiki.garrysmod.com/page/hook/Add"]hook.Add[/URL]
Ok.
[editline]7th August 2014[/editline]
[QUOTE=JasonMan34;45618123]Don't use GM hooks unless you're creating a new game mode.
Instead, use [URL="http://wiki.garrysmod.com/page/hook/Add"]hook.Add[/URL][/QUOTE]
So:
[code]
hook.Add( "pirate_chatsounds", "chatsounds", 1 )
local sounds = {}
sounds[ "Ye" ] = { "ye.wav" }
sounds[ "Brace Yarself" ] = sounds[ "brace.wav" ]
sounds[ "Fight" ] = sounds[ "fight.wav" ]
[/code]
Not the best with chat sounds and sound sin general sorry if i'm being cumb.
[QUOTE=MistyPanda;45618153]Ok.
[editline]7th August 2014[/editline]
So:
[code]
hook.Add( "pirate_chatsounds", "chatsounds", 1 )
local sounds = {}
sounds[ "Ye" ] = { "ye.wav" }
sounds[ "Brace Yarself" ] = sounds[ "brace.wav" ]
sounds[ "Fight" ] = sounds[ "fight.wav" ]
[/code]
Not the best with chat sounds and sound sin general sorry if i'm being cumb.[/QUOTE]
Did you read the hook.Add wiki page? It kinda states why your hook.Add command is wrong.
Anyways, since your script is client side, use the OnPlayerChat string
My friend said this should work:
[code]
local sounds = {}
sounds[ "after life" ] = { "garrysmod\sound\afterlife.wav" }
sounds[ "cast off" ] = { "garrysmod\sound\castoff.wav" }
sounds[ "dress" ] = { "garrysmod\sound\dress.wav" }
sounds[ "fish face" ] = { "garrysmod\sound\fishface.wav" }
sounds[ "jar of dirt" ] = { "garrysmod\sound\jar.wav" }
sounds[ "liar" ] = { "garrysmod\sound\liar.wav" }
sounds[ "pirates" ] = { "garrysmod\sound\pirates.wav" }
DarkRP.setChatSound = DarkRP.stub{
name = "setChatSound",
description = "Set a chat sound (play a noise when someone says something)",
parameters = {
{
name = "text",
description = "The text that should trigger the sound.",
type = "string",
optional = false
},
{
name = "sounds",
description = "A table of string sound paths.",
type = "table",
optional = false
}
},
returns = {
},
metatable = DarkRP
}
[/code]
How would I change:
[code]
DarkRP.setChatSound = DarkRP.stub{
name = "setChatSound",
description = "Set a chat sound (play a noise when someone says something)",
parameters = {
{
name = "text",
description = "The text that should trigger the sound.",
type = "string",
optional = false
},
{
name = "sounds",
description = "A table of string sound paths.",
type = "table",
optional = false
}
},
returns = {
},
metatable = DarkRP
}
[/code]
For PirateShipWars. Please do it for me, as this is my strongest strength of coding. If you want to.
An do would be very pleased If you could :S
Anyone?
Sorry, you need to Log In to post a reply to this thread.