Yes, and yes, first you will want to use a playerChatted event: developer.roblox.com/en-us/api-reference/event/Player/Chatted
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
end)
end)
now you will want to use the string manipulation library: https://developer.roblox.com/en-us/api-reference/lua-docs/string
local timeCommand= "/time"
local setTimeRemote = game:GetService("ReplicatedStorage").TimeRemote
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if message:sub(1, timeCommand:len()):lower() == timeCommand:lower() then
local time = message:sub(timeCommand:len() + 1)
game.Lighting:SetMinutesAfterMidnight(time * 60)
end
end)
end)
now for just setting it for one player you'd just utilize string.split and check for a 3rd arg which would be the player, :FireClient() that client and pretty much have that same function.. developer.roblox.com/en-us/api-reference/function/RemoteEvent/FireClient
I essentially spoonfed you the entire script, I hope you can figure it out from now on. If this helped you, please don't forget to accept this as an answer
1 comment
Might be lemme check