If player says "Random" he says random stuff

if player said random it picks a word from table and inserts it as his message

ok, so what do you need help here? do note that you cant just ask us to script the entire thing for you

well…
i did ask for entire script xD

Yes, im just telling you that you cant, in case you were asking for the entire script.
My main point is

ok, so what do you need help here?

read title if you need to know

thats not a question, if you need help with making the player say random stuff when they say “random”, you are asking for an entire script. You have to ask more specific stuff, atleast include a script of you attempting to make it work, so we know what we are helping you with

I think you can make command that random so like “/random” or “;random”
then I think these ones will help you

local Words = {"Lightbulb","Car"}
game.Players.PlayerAdded:Connect(function(Plr)
Plr.Chatted:Connect(function(Msg)
-- message must change here (but im dumb idk how to do it)
end)
end)

uh i said that player’s message (that he just messaged) must change (bc i want it use in bubble chat too)

Give a look in:

if you cant figure it out I guess ill help finish ur script (possibly, because I also might not be able to figure it out lol)

nope, even i tried something it just doesnt work

alr ill help ya but i have to do something right now

alright im back time to help you

Wait, I just noticed that it would techinically be a crosswoods situation if I actually make the player chat the random stuff, so instead, i’m just gonna make the bubble chat say that, but not the actual chat (or ill make a fake player in chat, if you want that, tell me, but ill do only the bubble chat for now)

1 Like

wait i think i saw one game with that mechanic before while friend showing me “fun” games

You mean the mechanic of forcing the player to say something in the real chat? cuz thats not allowed (a “recent” exploit made it so the game would force you to say very bad words and have bots that report you)

If I’m understanding here is what you want.

local Words = {“test”, “cool”, “yes”}

game.Players.PlayerAdded:Connect(function(Plr)
Plr.Chatted:Connect(function(Msg)

if Msg == “Random” then
local RandomWord = Words[math.random(1,#RandomWord)]

end 
end)
end)

This is the basic script. Now you just need to add something from here
Here

just please don’t abuse this in any way because the player will get the consequence!

local Game = game
local Chat = Game:GetService("Chat")
local Players = Game:GetService("Players")

local RandomObject = Random.new()
local RandomMessages = {"Hello world!", math.pi, "Roblox!"} --Add 'random' words/phrases here.

local function OnPlayerAdded(Player)
	local function OnChatted(Message)
		if string.lower(Message) == "random" then
			local Character = Player.Character
			if not Character then return end
			Chat:Chat(Character, RandomMessages[RandomObject:NextInteger(1, #RandomMessages)])
		end
	end
	
	Player.Chatted:Connect(OnChatted)
end

Players.PlayerAdded:Connect(OnPlayerAdded)