|
| 26 Sep 2013 07:04 PM |
words = {"Fire","Make Ready","Ready"} --case sensitive to match the names of the sounds in lighting
game.Players.PlayerAdded:connect(function(np) np.Chatted:connect(function(msg) for _,v in pairs(words) do if msg:lower():sub(1,#v) == v:lower() then local t = game.Lighting[v]:Clone() t.Parent = np.Character t:play() wait(1) --however long is the longest sound, I guess t:stop() t:destroy() end end end) end)
I've got the raw sounds in the lighting each named ""Fire, Make Ready, and Ready"". The script is supposed to make it so it plays the sound when you speak it. It doesn't seem to be working; i'm not that good with sounds. If anyone could help, that'd be great. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:05 PM |
It seems right...
Any output? |
|
|
| Report Abuse |
|
|
| |
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:45 PM |
Error:
if msg:lower():sub(1,#v) == v:lower() then
words = {"Fire","Make Ready","Ready"} --case sensitive to match the names of the sounds in lighting
game.Players.PlayerAdded:connect(function(np) np.Chatted:connect(function(msg) for _,v in pairs(words) do if msg:lower():sub(1,string.len(v)) == v:lower() then local t = game.Lighting[v]:Clone() t.Parent = np.Character t:play() wait(1) --however long is the longest sound, I guess t:stop() t:destroy() end end end) end)
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:45 PM |
| Did you try using remove error monitoring system to test online and check if there are any errors? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:46 PM |
| Arkose, that's not the error -.- |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:49 PM |
You can use # to determine the length of the string? wat.
I don't see anything else.
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:50 PM |
Yeah, you can, you can test it by:
x = "test" print(#x) |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:51 PM |
t:destroy()
Capitalize the d
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2013 07:51 PM |
| Lol you guys are confusing me. |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:51 PM |
@Cnt
That's what I just did <3.
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:52 PM |
| that lowercase d also doesn't matter lel |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:53 PM |
Ik, it's just bothering me k
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2013 07:53 PM |
| Some help would be nice. I've been trying to do this script for like 3 days now. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 07:54 PM |
Does the script break or does the music not play? Test it by making it kill the character or something |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2013 07:55 PM |
| I say the word, absolutely nothing happens. I honestly suck at scripting, hence why i'm on this forum, but it seems the output doesn't say anything, even when I remove and put it back in. |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 26 Sep 2013 07:55 PM |
inb4wearemissingsomethingsuperobvious
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Sep 2013 08:04 PM |
"np.Character" Make it to "np.Character.Torso" |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|