Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come my SoundList script does not work?

Asked by 10 years ago

I have done multiple changes in the script, and it is not working, the Output keeps saying local SoundList = { ["music"] = 130767645, ["music2"] = 130:8: attempt to index local 'v' (a number value) 19:37:48.574 - Stack Begin 19:37:48.574 - Script 'local SoundList = { ["music"] = 130767645, ["music2"] = 130', Line 8 19:37:48.575 - Stack End, but I do not understand what I am doing wrong, here is the script I am using;

local SoundList = {
["music"] = 130767645,
["music2"] = 130767645
}
local msg = "m/music"

for i,v in pairs(SoundList) do
if msg:lower():sub(1,2):find(v:lower())+5 then
print("ID found within list")
else
print("ID not existant within list")
end
end

1 answer

Log in to vote
-1
Answered by 10 years ago

Don't put the variables in brackets,. That should help, otherwise, you have to rewrite the whole script.

Ad

Answer this question