Hello
Im having trouble with my code, Idk how chat service works can someone please help?
How can I detect if a person said something in the chat and detect what rank are they in the group if they are in the group and they are higher than the rank 34 then make the GUI visible
I tried this code and it did not work
Can someone help?
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
local specificWord = "/etkinlik baĹźlat sword fight"
local groupId = 11617668
local requiredRank = 34
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if message:lower() == specificWord and player:IsInGroup(groupId) and player:GetRankInGroup(groupId) > requiredRank then
local etkinlikGui = StarterGui:FindFirstChild("EtkinlikGui")
if etkinlikGui then
local frame = etkinlikGui:FindFirstChild("Frame")
if frame then
frame.Visible = true
wait(15)
frame.Visible = false
else
warn("Frame not found inside EtkinlikGui")
end
else
warn("EtkinlikGui not found in StarterGui")
end
end
end)
end)
local Players = game:GetService("Players")
local specificWord = "/etkinlik baĹźlat sword fight"
local groupId = 11617668
local requiredRank = 34
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if message:lower() == specificWord then
if not player:IsInGroup(groupId) then
return warn(`{player.Name} are not in the group.`)
end
if not player:GetRankInGroup(groupId) > requiredRank then
return warn(`{player.Name} rank its too low`)
end
local etkinlikGui = player.PlayerGui:FindFirstChild("EtkinlikGui")
if etkinlikGui then
local frame = etkinlikGui:FindFirstChild("Frame")
if frame then
frame.Visible = true
task.wait(15)
frame.Visible = false
else
warn("Frame not found inside EtkinlikGui")
end
else
warn("EtkinlikGui not found in StarterGui")
end
end
end)
end)
Player.Chatted does not work on the client with the new chat. If this is in ServerScriptService than it should be fine?
I think this would be the alternative, but note that pretty much all of the easy alternatives with TextChatService don’t provide the unfiltered version of the message (unless that changed)
Thank you it worked but I already found a better solution, however how can I make a GUI only appear on a player’s screen not everyone’s screen when the button is clicked and how do i make a gui appear on everybody’s screen if a button is pressed.