nevermind I used JSON and it worked

I am making a deprecated table for my admin commands, so when a player tries a deprecated word, a pop up would appear telling him that the command is deprecated, I tried using the script below, but it didn't work.

LocalScript:

local DeprecatedWords = {":return"}
P.Chatted:Connect(function(msg)
   local deprecated = string.find(msg, DeprecatedWords)
   if deprecated then
       local H = Instance.new("Hint")
       H.Parent = game.Workspace
       H.Text = msg.." is deprecated"	
       wait(3)
       H:Destroy()
   end
 end)

And when I try the script above it gives me this error:bad argument #2 to 'find' (string expected, got table)

2 comments

0

do DeprecatedWords[1]

0

I used JSON to convert it from a table to string. Thanks, anyways.