So I have a script and when the "Admin" speaks a certain Phrase it executes a function but when I speak (I'm an Admin.) It executes the function to ANYTHING that I say and not the desired phrase/command. Here is the script. Please help! Much apreciated! :)
Admins = {"doctorbenny2011"}
function onChatted(msg)
if string.find(string.lower(msg), string.lower("Vortex")) and
string.find(string.lower(msg), string.lower("Open!")) then
on()
if string.find(string.lower(msg), string.lower("Vortex")) and
string.find(string.lower(msg), string.lower("Close!")) then
off()
end
end
end
game.Players.PlayerAdded:connect(function (guy)
for i,v in pairs(Admins) do
if string.lower(guy.Name) == string.lower(v) then
guy.Chatted:connect(onChatted)
guy.Chatted:connect(onChat)
end
end
end)
off()

3 comments
:sub the colon is red.
it shouldnt be, i use this layout for voice commands all the time, its never failed me so far.
quick fix.