game.Players.PlayerAdded:Connect(function (player)
player.Chatted:Connect(function(msg)
if msg == "find the square root of " -- this is where it checks what the number is, but I dont know what to do.
end)
end)
Then, I want to connect it to a variable like this:
game.Players.PlayerAdded:Connect(function (player)
player.Chatted:Connect(function(msg)
if msg == "find the square root of " then
local number = --the number the player says
end)
end)
game.Players.PlayerAdded:Connect(function (player)
player.Chatted:Connect(function(msg)
if msg == "find the square root of " then
local num = tonumber(string.match(msg, "%d+"))
local root = math.sqrt(num)
print(root)
end
end)
end)
game.Players.PlayerAdded:Connect(function (player)
player.Chatted:Connect(function(msg)
if string.match(msg:lower(), "find the square root of ") then
local num = tonumber(string.match(msg, "%d+"))
local root = math.sqrt(num)
print(root)
end
end)
end)