I made a PlayerChatted script that works in the Play mode but doesnt work in game. I'm pretty sure this has something to do with FilteringEnabled (correct me if I'm wrong). Please help.
The script is supposed to delete one of two cars when I chat a command. It works in Play but not anything else.
passat = script.Parent.Passat
jeep = script.Parent["2016 Jeep Grand Cherokee"]
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if player.Name == "richguyty" then
if msg == "-passat" or msg == "keepjeep" then
passat:Destroy()
script:Destroy()
elseif msg == "-jeep" or msg == "keeppassat" then
jeep:Destroy()
script:Destroy()
elseif msg == "+bothcars" or msg == "keepbothcars" then
script:Destroy()
end
end
end)
end)

7 comments
Is "+bothcars" supposed to be "-bothcars"?
No, that line is mean't to keep both cars and delete the script. Sorry, I should have clarified that.
Have you tried turning off filtering enabled to check if that is the problem?
The only thing I can think of that would break that is your name not being richguyty when you try to use it. I don't think FilteringEnabled would affect it, based on this information: https://developer.roblox.com/en-us/api-reference/property/Workspace/FilteringEnabled
@Marty999 :xd: You can't turn off FE anymore; the property in studio is a dummy, and toggles whether "your game was updated to fe".
local script or script?
Script