game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if message == ";set dayLength" then
end
end)
end)
But there i dont know what to do. I need to get a number from message. For example: If player chatted “;set dayLength 14” , dayLength will be set to 14. So how do i do this?
local command = string.split(";set dayLenght", " ") -- the command
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
local splitMessage = string.split(message, " ")
if splitMessage[1] == command[1] and splitMessage[2] == command[2] then
print(splitMessage[3])
end
end)
end)