I’m fairly new to using the chat service. I’m trying to check if a player types out a specific message, and if they do to make a GUI appear. I’m not quite sure what I’m doing wrong.
local Players = game:GetService("Players")
local Chat = game:GetService("Chat")
Players.PlayerAdded:Connect(function(player)
Chat.Chatted:Connect(function(character, message)
if message == ";LaunchGUI" then
player.PlayerGui:WaitForChild("ScreenGui")
player.PlayerGui.ScreenGui.Frame.Visible = true
end
end)
end)
Am I using the parameters wrong? The script is stored in server script service.
local Players = game:GetService("Players")
local Chat = game:GetService("Chat")
Players.PlayerAdded:Connect(function(player)
Player.Chatted:Connect(function(message)
if message == ";LaunchGUI" then
player.PlayerGui:WaitForChild("ScreenGui")
player.PlayerGui.ScreenGui.Frame.Visible = true
end
end)
end)
Corrected code. You don’t use the chat service to check if a Player is chatted. This is a PlayerObject based event.
Does this only show up on the player who chatted the word or the whole server, if its only the player how can I make the whole server see the gui when I type a specific message