Advertisement
Parallaxox

Chat Commands

Feb 26th, 2025 (edited)
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | Software | 0 0
  1. --https://youtu.be/VvZHJOXxOSw
  2. local Players = game:GetService("Players")
  3.  
  4. local function onPlayerChatted(player, message)
  5.     message = message:lower()  -- Make the command case-insensitive
  6.     if message == "!hello" then
  7.         print("Hello, " .. player.Name .. "! Welcome to the game.")
  8.     end
  9. end
  10.  
  11. Players.PlayerAdded:Connect(function(player)
  12.     player.Chatted:Connect(function(message)
  13.         onPlayerChatted(player, message)
  14.     end)
  15. end)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement