Chat Level Up System

I want to know how to make a chat level system. So when ever you talk lets say every 30 sentences you level up. I do not know how to do that.

I know how to make a normal level system, but not a ‘chat’ level system.

If you could help me out, that would be appreciated greatly.

1 Like

Try using Player.Chatted to detect whenever a player sends a message.

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		print(Message)
	end)
end)
1 Like

I just spent the last 20 minutes typing up this script for you. Hope it works:

A ServerScript (can go in serverscriptservice or workspace)

local remote = Instance.new('RemoteEvent', game.ReplicatedStorage)
remote.Name = "ShowChatLevelMsg"
function showMsg(msg) -- this is the function to show a message to everyone
	remote:FireAllClients({  
	    Text = msg; 
        Color = BrickColor.new("Beige").Color; 
        Font = Enum.Font.SourceSans;
        FontSize = Enum.FontSize.Size18; 
   })
end
local lvl_up = 7
local leaderstats = true -- Set this to false to disable leaderstats!
game.Players.PlayerAdded:Connect(function(player)
	showMsg(player.Name .. " has joined! Talk to level up!")
	local chats = 0
	local player_lvl = 0
	local lvl = Instance.new('IntValue')
	lvl.Name = "ChatLevel"
	if lvl_up <= 3 then
		wait(5) return showMsg('The chat system\'s level up feature is too low, it wont work!'), showMsg('Reverting ..'), script:Destroy() -- stops the whole script (i hope)
	end
	if leaderstats then
		local leaderstats = Instance.new('Folder', player)
		leaderstats.Name = "leaderstats"
		lvl.Parent = leaderstats
	end
	player.Chatted:Connect(function(msg)
		if not string.find(msg, ".") then -- this is the function to fix sentences
			chats = chats + 1
		elseif string.find(msg, ".%a") then
			local a, times = string.find(msg, ".%a")
			chats = chats + times
		end
		if chats >= lvl_up then
			chats = 0
			player_lvl += 1
			wait(0.25)
			print('Player '.. player.Name .. ' has leveled up to level '.. player_lvl ..'!')
			showMsg('Player '.. player.Name .. ' has leveled up to level '.. player_lvl ..'!')
			lvl.Value = player_lvl
		end
	end)
end)

And a localscript in the toolbox or startergui:

game.ReplicatedStorage:WaitForChild('ShowChatLevelMsg').OnClientEvent:Connect(function(chatProperties)
    game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",chatProperties)
end)

It should find sentences and add more points depending on the amount of sentences, but it also gives you a point even if you dont use a .

EDIT: Just made an update and fixed it so it doesn’t automatically revert! :happy3:

- Added leaderstats so it can be easily accessed, maybe for shops, etc.
- Added a limit to how low the sentence count can go and if too low will remove everything.

It’s not perfect, but it still works. Tell me if there are any problems

- infiniteraymond

6 Likes

thanks man! really helped me out

1 Like

but, will a normal data store fix it from restarting your levels when you join the game again? Or there need to be a whole data store for the level system

Any datastore should work, just set the datastore value to the leaderstat before the character leaves with

game.Players.PlayerRemoving:Connect(function(player)
    -- code for datastore here!
end)

and load it in after the leaderstat gets created with

player_lvl = datastore -- change the "datastore" to the get async of the datastore!

and you should be good to go! Tell me if anything else is wrong and i’ll be happy to help!

:happy2:

Also, would you mind if I created a post for this (when I add some finishing touches) in Community Creations?

I think it could be used in tons of games, and if I made it into an open-sourced model it would be easier for people to get ahold of.

I don’t mind you saying no, thats the whole reason im asking :happy1:

1 Like

its fine with me :smiley: go ahead!

I’m almost done making a datastore version;
just need to do some testing!

I’ll edit when I get it ready! :happy3:

EDIT: Alright, its finished. Tell me if it works!
(Make sure you enable “Enable Studio Access to API Services” in Settings > Security!)

https://www.roblox.com/library/5585761547/Chat-Level-Up-System

2 Likes

ok I will be ready to see it aswell!

tell me when you do :blush: ill be ready

Posted it here: Chat Level Up System [NOT BEING UPDATED ANYMORE]

Anyway, have a nice day, sir! (lol)

1 Like

thanks bro! I’ll see you in the future. Goodluck with your work

2 Likes