So, I've been trying to do chat commands and stuff, but when you say the command word in a sentence it doesn't activate. I THINK you have to use :match() for this? I don't know, so could anyone help me out? Here's the test code:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
player.Chatted:Connect(function(message)
if message:lower() == "lumos" then
game.ReplicatedStorage.LumosEvent:FireServer(mouse.Hit.p)
end
end)

1 comment
The code itself works fine, I just don't know how to detect the command word in a statement