Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local localPlayer = Players.LocalPlayer
- -- Function to listen for chat messages and send "hi" back
- local function onPlayerChat(message)
- -- Check if the player typed "hi"
- if message:lower() == "hi" then
- -- Respond with "hi"
- game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer("hi", "All")
- end
- end
- -- Connect the chat function to the Chatted event
- localPlayer.Chatted:Connect(onPlayerChat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement