I was wondering how to do this last night, and I hope you can help. I am modifying the bubble chat script to have randomized messages.

local function createChatLine(message, bubbleColor, isLocalPlayer)
	
	local Strings = {'woah ', 'trip ', 'like ', 'man, ', 'help ', 'damn ', 'wow ', 'i like ', 'feels ', 'good ', 'great ', 'bad ', 'awful ', 'death ', 'drug ', '', 'please ', 'cool ', 'why ', 'go ', ''}
	local this = {}
	
	function this:ComputeBubbleLifetime(msg, isSelf)
		if isSelf then
			return lerpLength(msg,8,15)
		else
			return lerpLength(msg,12,20)
		end
	end
	
	
	this.Origin = nil
	this.RenderBubble = nil
	this.Message =	Strings[math.random(1,#Strings)] .. Strings[math.random(1,#Strings)] .. Strings[math.random(1,#Strings)] .. Strings[math.random(1,#Strings)]
	this.BubbleDieDelay = this:ComputeBubbleLifetime(message, isLocalPlayer)
	this.BubbleColor = bubbleColor
	this.IsLocalPlayer = isLocalPlayer

	return this
end

2 comments

0

Did you try Math.random?

0

I have tried