-- MAIN SCRIPT --


MessagingService:SubscribeAsync('Message', function(Data)

	local MessageData = HttpService:JSONDecode(Data.Data)

	local MessageValue = ReplicatedStorage:FindFirstChild(MessageData.Type..'Text')
	
	if MessageValue then
		
		local WaitTime = tonumber(#MessageData.Message * 0.5)
		
		MessageValue.Value = MessageData.Message
		
		wait(WaitTime)
		
		MessageValue.Value = ''
		
	end
	
end)
