local groupId =
3809008
local dataStore = game:GetService("DataStoreService"):GetDataStore("UserCredits")
if game.CreatorType == Enum.CreatorType.Group then
groupId = game.CreatorId
elseif game.CreatorType == Enum.CreatorType.User and groupId < 1 then
local hint = Instance.new("Hint",game.Workspace)
hint.Text = "YouFoundJojo's Leaderboard - Uh oh! Group ID was not found! Please try again!"
game:GetService("Debris"):AddItem(hint,30)
end
game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
stats.Parent = player
local credits = Instance.new("IntValue")
credits.Name = "Levels"
credits.Parent = stats
if groupId > 0 then
local rank = Instance.new("StringValue")
rank.Name = "Rank"
rank.Value = player:GetRoleInGroup(groupId)
rank.Parent = stats
end
if dataStore:GetAsync("Key" .. player.UserId) then
credits.Value = dataStore:GetAsync("Key" .. player.UserId)
else
credits.Value = 0
end
credits.Changed:connect(function(save)
dataStore:SetAsync("Key" .. player.UserId, save)
end)
end)
Ok so the goal was to have a player receive points when a group rank of 254+ says :add cantbeatmerbro levels 1. But for some reason, the script won't work for my game but it does work for my friends. We both own group games. I am not sure how to fix this if anyone can help let me know because i would really appreciate it!

2 comments
Hint objects are deprecated, switch to TextLabels. The parent argument to instance.new is also deprecated. :connect as well.
Nowhere in the script do you even check for a player chatting. Obviously it doesn't work because there is nothing in the script that listens for a player's message